Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/manual-prepare_release_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,17 @@ jobs:
runs-on: ubuntu-latest
needs: bump_and_branch
steps:
- name: Create App token
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
client-id: ${{ vars.MOBILE_CI_APP_CLIENT_ID }}
private-key: ${{ secrets.MOBILE_CI_APP_PRIVATE_KEY }}
permission-contents: read
permission-pull-requests: write
- name: Build PR body and open PR
env:
GITHUB_TOKEN: ${{ secrets.PAT_FOR_TRIGGERING_BRANCH_PROTECTION }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
SRC: ${{ needs.bump_and_branch.outputs.release_branch }}
DST: ${{ github.event.inputs.target_branch }}
REPO: ${{ github.repository }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-common-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
branch: ${{ github.ref_name }}
secrets:
PAT_FOR_TRIGGERING_BRANCH_PROTECTION: ${{ secrets.PAT_FOR_TRIGGERING_BRANCH_PROTECTION }}
MOBILE_CI_APP_PRIVATE_KEY: ${{ secrets.MOBILE_CI_APP_PRIVATE_KEY }}

publish-from-pr:
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
Expand All @@ -46,4 +46,4 @@ jobs:
with:
branch: ${{ github.base_ref }}
secrets:
PAT_FOR_TRIGGERING_BRANCH_PROTECTION: ${{ secrets.PAT_FOR_TRIGGERING_BRANCH_PROTECTION }}
MOBILE_CI_APP_PRIVATE_KEY: ${{ secrets.MOBILE_CI_APP_PRIVATE_KEY }}
19 changes: 13 additions & 6 deletions .github/workflows/publish-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
required: true
type: string
secrets:
PAT_FOR_TRIGGERING_BRANCH_PROTECTION:
MOBILE_CI_APP_PRIVATE_KEY:
required: true

permissions:
Expand Down Expand Up @@ -106,19 +106,26 @@ jobs:
startsWith(github.head_ref, 'release/') &&
github.base_ref == 'master'
runs-on: ubuntu-latest
env:
# gh uses this PAT, not the workflow GITHUB_TOKEN — needed so the merge PR
# re-triggers branch-protection checks. Job-level `permissions:` only scope
# the workflow token, so they don't apply to these gh calls.
GITHUB_TOKEN: ${{ secrets.PAT_FOR_TRIGGERING_BRANCH_PROTECTION }}
steps:
- name: Create App token
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
client-id: ${{ vars.MOBILE_CI_APP_CLIENT_ID }}
private-key: ${{ secrets.MOBILE_CI_APP_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- name: Checkout develop branch
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: develop
- name: Create Pull Request
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh pr create --base develop --head master --title "Merge 'master' into 'develop' after release" --body "Automated Pull Request to merge 'master' into 'develop' after release"
- name: Merge Pull Request
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
pr_number=$(gh pr list --base develop --head master --json number --jq '.[0].number')
gh pr merge "$pr_number" --merge --auto
Loading