Skip to content

Commit

Permalink
chore: refactor github actions
Browse files Browse the repository at this point in the history
Refactor GitHub actions to use the manually retrieved labels as triggers
instead on triggering on labels.

Signed-off-by: Noel Georgi <git@frezbo.dev>
  • Loading branch information
frezbo committed Oct 30, 2023
1 parent 9a05d12 commit 5a22409
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: default
concurrency:
group: ${{ github.event.label == null && github.head_ref || github.run_id }}
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
Expand All @@ -13,19 +13,16 @@ on:
branches:
- main
- release-*
types:
- opened
- synchronize
- reopened
- labeled
jobs:
default:
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/')) && (github.event.label == null || (contains(fromJSON('["integration/reproducibility"]'), github.event.label.name)))
if: (!startsWith(github.head_ref, 'renovate/') && !startsWith(github.head_ref, 'dependabot/'))
permissions:
packages: write
runs-on:
- self-hosted
- pkgs
outputs:
labels: ${{ steps.workflow-run-info.outputs.pullRequestLabels }}
services:
buildkitd:
image: moby/buildkit:buildx-stable-1
Expand Down Expand Up @@ -63,11 +60,16 @@ jobs:
if: github.event_name != 'pull_request'
run: |
make PUSH=true
- name: Retrieve workflow info
id: workflow-run-info
uses: potiuk/get-workflow-origin@v1_5
with:
token: ${{ secrets.GITHUB_TOKEN }}
reproducibility:
runs-on:
- self-hosted
- pkgs
if: ${{ contains(github.event.pull_request.labels.*.name, 'integration/reproducibility') }}
if: contains(needs.default.outputs.labels, 'integration/reproducibility')
needs:
- default
services:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: weekly
concurrency:
group: ${{ github.event.label == null && github.head_ref || github.run_id }}
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
schedule:
Expand Down

0 comments on commit 5a22409

Please sign in to comment.