Skip to content

Commit a9afc18

Browse files
authored
ci: addresses issues with workflows mirroring changes to deployments (resolves #2361, #2362) (#2363)
* ci: trigger mirror action after release * ci: allow mirror workflows to be triggered manually
1 parent 9f71a3a commit a9afc18

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

.github/workflows/merge-release.yml

+9-13
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ jobs:
2727
name: Merge tag
2828

2929
steps:
30+
- uses: actions/create-github-app-token@v1
31+
id: app-token
32+
with:
33+
app-id: ${{ vars.GHA_APP_ID }}
34+
private-key: ${{ secrets.GHA_PRIVATE_KEY }}
35+
3036
- name: Determine branch
3137
run: |
3238
echo 'BRANCH='${{ inputs.branch || 'staging' }} >> $GITHUB_ENV
@@ -37,12 +43,7 @@ jobs:
3743
ref: ${{ env.BRANCH }}
3844
fetch-tags: true
3945
fetch-depth: 0
40-
41-
- uses: actions/create-github-app-token@v1
42-
id: app-token
43-
with:
44-
app-id: ${{ vars.GHA_APP_ID }}
45-
private-key: ${{ secrets.GHA_PRIVATE_KEY }}
46+
token: ${{ steps.app-token.outputs.token }}
4647

4748
- name: Get GitHub App User ID
4849
if: ${{ github.event_name == 'release' }}
@@ -78,14 +79,9 @@ jobs:
7879
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7980
ACCOUNT_ID: ${{ github.actor_id }}
8081

81-
- name: Merge tag to local "${{ env.BRANCH }}" branch
82+
- name: Merge tag to "${{ env.BRANCH }}" branch
8283
run: |
8384
git config --local user.email "$GIT_USER_EMAIL"
8485
git config --local user.name "$GIT_USER_NAME"
8586
git merge ${{ inputs.tag || github.event.release.tag_name }}
86-
87-
- name: Push merge to repository's "${{ env.BRANCH }}" branch
88-
uses: ad-m/[email protected]
89-
with:
90-
github_token: ${{ steps.app-token.outputs.token }}
91-
branch: ${{ env.BRANCH }}
87+
git push

.github/workflows/mirror-dev.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717
with:
18+
ref: dev
1819
fetch-depth: 0
1920

2021
- name: Set up Git

.github/workflows/mirror-production.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717
with:
18+
ref: production
1819
fetch-depth: 0
1920

2021
- name: Set up Git

.github/workflows/mirror-staging.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
1717
with:
18+
ref: staging
1819
fetch-depth: 0
1920

2021
- name: Set up Git

0 commit comments

Comments
 (0)