mirror of
https://github.com/RetroDECK/components-template.git
synced 2024-11-21 10:55:39 +00:00
Removing Rekku token as reusable workflow as GitHub is not able to pass the tokens between jobs
This commit is contained in:
parent
c6ca7385ed
commit
d53472c566
20
.github/workflows/build_artifacts.yml
vendored
20
.github/workflows/build_artifacts.yml
vendored
|
@ -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 }}
|
||||
|
|
25
.github/workflows/generate_rekku_token.yml
vendored
25
.github/workflows/generate_rekku_token.yml
vendored
|
@ -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
|
18
.github/workflows/pr_from_upstream.yml
vendored
18
.github/workflows/pr_from_upstream.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue