Skip to content

Commit

Permalink
misc: uniform GitHub action (#5069)
Browse files Browse the repository at this point in the history
* Update azure-devops-issue-sync.yml

* Update chart-sync.yaml

* Update create-release.yml

* Update enterprise-repo-sync.yaml

* Update pager-duty-issue-escalate.yaml

* Update update-release-notes.yml

* Update chart-sync.yaml

* Update create-release.yml

* Update enterprise-repo-sync.yaml

* Update update-release-notes.yml

* Update enterprise-repo-sync.yaml

---------

Co-authored-by: Prakarsh <71125043+prakarsh-dt@users.noreply.github.com>
  • Loading branch information
jatin-jangir-0220 and prakarsh-dt authored May 6, 2024
1 parent 42a52ab commit ec1fe87
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/azure-devops-issue-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: danhellem/github-actions-issue-to-work-item@v2.1
env:
ado_token: "${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}"
github_token: "${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}"
github_token: "${{ secrets.GH_SYSTEMSDT_TOKEN }}"
ado_organization: "DevtronLabs"
ado_project: "Devtron"
ado_wit: "Bug"
Expand All @@ -26,7 +26,7 @@ jobs:
uses: danhellem/github-actions-issue-to-work-item@v2.1
env:
ado_token: "${{ secrets.ADO_PERSONAL_ACCESS_TOKEN }}"
github_token: "${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}"
github_token: "${{ secrets.GH_SYSTEMSDT_TOKEN }}"
ado_organization: "DevtronLabs"
ado_project: "Devtron"
ado_wit: "User Story"
Expand All @@ -50,7 +50,7 @@ jobs:
steps:
- uses: wow-actions/potential-duplicates@v1
with:
GITHUB_TOKEN: "${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.GH_SYSTEMSDT_TOKEN }}"
# Issue title filter work with anymatch https://www.npmjs.com/package/anymatch.
# Any matched issue will stop detection immediately.
# You can specify multi filters in each line.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/chart-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
script-file: ${{ secrets.CHART_SYNC_SCRIPT_FILE }}
git-target-repo: ${{ secrets.GIT_TARGET_REPO }}
git-source-repo: ${{ secrets.GIT_SOURCE_REPO }}
git-target-useremail: ${{ secrets.GIT_TARGET_EMAIL }}
git-target-username: ${{ secrets.GIT_TARGET_USERNAME }}
git-target-token: ${{ secrets.GIT_TARGET_TOKEN }}
git-target-useremail: ${{ secrets.GH_SYSTEMSDT_EMAIL }}
git-target-username: ${{ vars.GH_SYSTEMSDT_USERNAME }}
git-target-token: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
git-target-dir: ${{ secrets.GIT_TARGET_DIR }}
git-source-dir: ${{ secrets.GIT_SOURCE_DIR }}
working-dir: ${{ secrets.WORKING_DIR }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ jobs:
echo "Not creating release due to beta"
fi
env:
GH_TOKEN: ${{ secrets.GIT_TOKEN }}
GH_TOKEN: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
RELEASE_BRANCH: ${{ secrets.RELEASE_BRANCH }}
GIT_CONFIG_NAME: ${{ secrets.GIT_TARGET_USERNAME }}
GIT_CONFIG_EMAIL: ${{ secrets.GIT_TARGET_EMAIL }}
GIT_CONFIG_NAME: ${{ vars.GH_SYSTEMSDT_USERNAME }}
GIT_CONFIG_EMAIL: ${{ secrets.GH_SYSTEMSDT_EMAIL }}
# Send notification on discord
- name: discord-notify
run: |
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/enterprise-repo-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,26 @@ jobs:
sync:
runs-on: ubuntu-latest
steps:
- run: |
- env:
GH_TOKEN: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
GIT_CONFIG_NAME: ${{ vars.GH_SYSTEMSDT_USERNAME }}
GIT_CONFIG_EMAIL: ${{ secrets.GH_SYSTEMSDT_EMAIL }}
run: |
export GIT_USERNAME="${GIT_CONFIG_NAME}"
export GIT_PASSWORD="${GH_TOKEN}"
export ENTERPRISE_REPO="https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/devtron-labs/devtron-enterprise.git"
git clone https://github.com/devtron-labs/devtron
git clone $ENTERPRISE_REPO
cd devtron && export GIT_COMMIT_ID=`git log --format="%H" -n 1`
export GIT_COMMIT=${GIT_COMMIT_ID:0:8}
echo $GIT_COMMIT
git config --global user.email $GIT_CONFIG_EMAIL
git config --global user.name $GIT_USERNAME
git status && git checkout main && git pull
cd ../devtron-enterprise && git status && git checkout main && git pull
git remote add oss-devtron ../devtron && git remote -v && git remote update && git merge oss-devtron/main
export WIRE_GEN_FILE_NAME="wire_gen.go"
export CONFLICT_FILES=`git diff --name-only --diff-filter=U --relative`
if [[ $WIRE_GEN_FILE_NAME = $CONFLICT_FILES ]]
then
rm $WIRE_GEN_FILE_NAME
Expand All @@ -49,7 +48,3 @@ jobs:
git checkout -b oss-enterprise-sync-$GIT_COMMIT && git push -u origin oss-enterprise-sync-$GIT_COMMIT
PR_RESPONSE=$(gh pr create --title "SYNC: OSS sync for $GIT_COMMIT" --fill --base main --head oss-enterprise-sync-$GIT_COMMIT --repo $ENTERPRISE_REPO)
echo "FINAL PR RESPONSE: $PR_RESPONSE"
env:
GH_TOKEN: ${{ secrets.GIT_TARGET_TOKEN }}
GIT_CONFIG_NAME: ${{ secrets.GIT_TARGET_USERNAME }}
GIT_CONFIG_EMAIL: ${{ secrets.GIT_TARGET_EMAIL }}
4 changes: 2 additions & 2 deletions .github/workflows/pager-duty-issue-escalate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: List issues with 'pager-duty' label
env:
GITHUB_TOKEN: ${{ secrets.GIT_TARGET_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
run: |
issues=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
Expand All @@ -39,7 +39,7 @@ jobs:
assignee3="vivek-devtron"
curl -X POST \
-H "Authorization: token ${{ secrets.GIT_TARGET_TOKEN }}" \
-H "Authorization: token ${{ secrets.GH_SYSTEMSDT_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d "{\"assignees\": [\"$assignee1\", \"$assignee2\", \"$assignee3\"]}" \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue_number/assignees"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ jobs:
git commit -am "Updated release notes"
git push https://${GIT_CONFIG_NAME}:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY} $RELEASE_NOTES_BRANCH
env:
GH_TOKEN: ${{ secrets.GIT_TOKEN }}
GIT_CONFIG_NAME: ${{ secrets.GIT_TARGET_USERNAME }}
GIT_CONFIG_EMAIL: ${{ secrets.GIT_TARGET_EMAIL }}
GH_TOKEN: ${{ secrets.GH_SYSTEMSDT_TOKEN }}
GIT_CONFIG_NAME: ${{ vars.GH_SYSTEMSDT_USERNAME }}
GIT_CONFIG_EMAIL: ${{ secrets.GH_SYSTEMSDT_EMAIL }}

0 comments on commit ec1fe87

Please sign in to comment.