Removing Rekku token as reusable workflow as GitHub is not able to pass the tokens between jobs

This commit is contained in:
XargonWan 2024-11-13 13:18:39 +09:00
parent c6ca7385ed
commit d53472c566
3 changed files with 21 additions and 42 deletions

View file

@ -22,16 +22,8 @@ env:
jobs:
# Generate Rekku Token Job
Generate-Rekku-Token:
uses: RetroDECK/components-template/.github/workflows/generate_rekku_token.yml@main
secrets:
REKKU_PRIVATE_KEY: ${{ secrets.REKKU_PRIVATE_KEY }}
Building-project:
runs-on: ubuntu-latest
env:
REKKU_TOKEN: ${{ needs.Generate-Rekku-Token.outputs.rekku_token }}
steps:
@ -106,6 +98,16 @@ jobs:
id: branch_name
run: echo "BRANCH_NAME=$(echo $GITHUB_REF | sed 's|refs/heads/||')" >> $GITHUB_ENV
- name: Generate a token for Rekku
if: ${{ github.repository == 'RetroDECK/RetroDECK' }}
id: generate-rekku-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.REKKU_APP_ID }}
private-key: ${{ secrets.REKKU_PRIVATE_KEY }}
repositories: "RetroDECK,Cooker"
owner: "RetroDECK"
- name: Publish the artifacts in a new release
uses: ncipollo/release-action@v1
with:
@ -117,4 +119,4 @@ jobs:
artifacts: "RetroDECK-Artifact.tar.gz, tree.html, RetroDECK-Artifact.sha"
allowUpdates: true
makeLatest: true
token: ${{ steps.generate-rekku-token.outputs.token || secrets.TRIGGER_BUILD_TOKEN || secrets.GITHUB_TOKEN }}
token: ${{ steps.generate-rekku-token.outputs.token || secrets.TRIGGER_BUILD_TOKEN }}

View file

@ -1,25 +0,0 @@
name: "Generate a token for Rekku"
on:
workflow_call:
secrets:
REKKU_PRIVATE_KEY:
required: false
jobs:
Generate-a-token-for-Rekku:
runs-on: ubuntu-latest
outputs:
rekku_token: ${{ steps.generate-rekku-token.outputs.token }}
steps:
- name: Generate a token for Rekku
id: generate-rekku-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.REKKU_APP_ID }}
private-key: ${{ secrets.REKKU_PRIVATE_KEY }}
owner: "RetroDECK"
skip-token-revoke: true

View file

@ -10,16 +10,8 @@ on:
jobs:
# Generate Rekku Token Job
Generate-Rekku-Token:
uses: RetroDECK/components-template/.github/workflows/generate_rekku_token.yml@main
secrets:
REKKU_PRIVATE_KEY: ${{ secrets.REKKU_PRIVATE_KEY }}
sync-upstream:
runs-on: ubuntu-latest
env:
REKKU_TOKEN: ${{ needs.Generate-Rekku-Token.outputs.rekku_token }}
steps:
- name: Checkout repository
@ -75,6 +67,16 @@ jobs:
echo "GIT_DIFF=$git diff --minimal" >> $GITHUB_ENV
- name: Generate a token for Rekku
if: ${{ github.repository == 'RetroDECK/RetroDECK' }}
id: generate-rekku-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.REKKU_APP_ID }}
private-key: ${{ secrets.REKKU_PRIVATE_KEY }}
repositories: "RetroDECK,Cooker"
owner: "RetroDECK"
- name: Push changes to new branch
if: success()
uses: ad-m/github-push-action@master