@@ -46,15 +46,22 @@ jobs:
4646 DOWNSTREAM_REMOTE : origin # IFU target remote name
4747 DOWNSTREAM_REPO : ${{ inputs.ifu_target_repo }} # target repo for IFU (fork); actions/checkout sets this to origin
4848 DOWNSTREAM_BRANCH : ${{ inputs.ifu_target_branch }} # target branch for IFU
49- GH_TOKEN : ${{ secrets.IFU_GITHUB_TOKEN }} # used by gh; provided by Action
5049 steps :
50+ - name : Generate GitHub App token
51+ id : app-token
52+ uses : actions/create-github-app-token@v1
53+ with :
54+ app-id : ${{ secrets.APP_ID }}
55+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
56+ owner : rocm
57+ repositories : pytorch
58+
5159 - name : Checkout repository (${{ env.DOWNSTREAM_REPO }}) (full history)
5260 uses : actions/checkout@v4
5361 with :
5462 repository : ${{ env.DOWNSTREAM_REPO }}
5563 path : ${{ env.DOWNSTREAM_REPO }}
5664 ref : ${{ env.DOWNSTREAM_BRANCH }}
57- token : ${{ env.GH_TOKEN }}
5865 fetch-depth : 0 # need full history for merges/tags
5966 submodules : recursive
6067
@@ -115,18 +122,24 @@ jobs:
115122
116123 - name : Push branch & tag to fork
117124 working-directory : ${{ env.DOWNSTREAM_REPO }}
125+ env :
126+ GH_TOKEN : ${{ steps.app-token.output.token }}
118127 run : |
119128 git push ${DOWNSTREAM_REMOTE} "${{ steps.tag.outputs.TAG }}"
120129
121130 - name : Authenticate gh (non-interactive)
122131 working-directory : ${{ env.DOWNSTREAM_REPO }}
132+ env :
133+ GH_TOKEN : ${{ steps.app-token.output.token }}
123134 run : |
124135 # The GitHub-hosted runner has gh preinstalled.
125136 gh auth status || echo "$GH_TOKEN" | gh auth login --with-token
126137 gh repo set-default "${{ env.DOWNSTREAM_REPO }}"
127138
128139 - name : Create Pull Request with gh
129140 working-directory : ${{ env.DOWNSTREAM_REPO }}
141+ env :
142+ GH_TOKEN : ${{ steps.app-token.output.token }}
130143 run : |
131144 BASE="${DOWNSTREAM_BRANCH}"
132145 HEAD="${{ steps.tag.outputs.TAG }}"
0 commit comments