mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-24 22:26:43 -05:00
ci: fix workflows with tokens running on forks
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
8b39d3d368
commit
c7ecf13e7f
8
.github/workflows/test-go-generate.yml
vendored
8
.github/workflows/test-go-generate.yml
vendored
@ -17,7 +17,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: constellation
|
path: constellation
|
||||||
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
||||||
token: ${{ secrets.TIDY_RENOVATE_PUSH }}
|
token: ${{ !github.event.pull_request.head.repo.fork && secrets.TIDY_RENOVATE_PUSH || '' }}
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||||
@ -54,7 +54,11 @@ jobs:
|
|||||||
git diff --exit-code
|
git diff --exit-code
|
||||||
|
|
||||||
- name: Push changes on renovate branch
|
- name: Push changes on renovate branch
|
||||||
if: failure() && (steps.generatecheck.conclusion == 'failure') && startsWith(github.head_ref, 'renovate/')
|
if: |
|
||||||
|
failure() &&
|
||||||
|
(steps.generatecheck.conclusion == 'failure')
|
||||||
|
&& startsWith(github.head_ref, 'renovate/') &&
|
||||||
|
!github.event.pull_request.head.repo.fork
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: constellation
|
working-directory: constellation
|
||||||
run: |
|
run: |
|
||||||
|
15
.github/workflows/test-tidy.yml
vendored
15
.github/workflows/test-tidy.yml
vendored
@ -25,7 +25,8 @@ jobs:
|
|||||||
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
||||||
with:
|
with:
|
||||||
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
||||||
token: ${{ secrets.TIDY_RENOVATE_PUSH }}
|
# No token available for forks, so we can't push changes
|
||||||
|
token: ${{ !github.event.pull_request.head.repo.fork && secrets.TIDY_RENOVATE_PUSH || '' }}
|
||||||
|
|
||||||
- name: Setup Go environment
|
- name: Setup Go environment
|
||||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||||
@ -51,7 +52,11 @@ jobs:
|
|||||||
# modules again and commit the changes, so the user doesn't need to do it.
|
# modules again and commit the changes, so the user doesn't need to do it.
|
||||||
|
|
||||||
- name: Tidy modules on renovate branches
|
- name: Tidy modules on renovate branches
|
||||||
if: ${{ failure() && (steps.tidycheck.conclusion == 'failure') && startsWith(github.head_ref, 'renovate/') }}
|
if: |
|
||||||
|
failure() &&
|
||||||
|
(steps.tidycheck.conclusion == 'failure') &&
|
||||||
|
startsWith(github.head_ref, 'renovate/') &&
|
||||||
|
!github.event.pull_request.head.repo.fork
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mods="${{ steps.submods.outputs.submods }}"
|
mods="${{ steps.submods.outputs.submods }}"
|
||||||
@ -60,7 +65,11 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
- name: Push changes
|
- name: Push changes
|
||||||
if: ${{ failure() && (steps.tidycheck.conclusion == 'failure') && startsWith(github.head_ref, 'renovate/') }}
|
if: |
|
||||||
|
failure() &&
|
||||||
|
(steps.tidycheck.conclusion == 'failure') &&
|
||||||
|
startsWith(github.head_ref, 'renovate/') &&
|
||||||
|
!github.event.pull_request.head.repo.fork
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "renovate[bot]"
|
git config --global user.name "renovate[bot]"
|
||||||
|
Loading…
Reference in New Issue
Block a user