Fixes to the new Image build actions (#26056)

This commit is contained in:
Renaud Chaput
2023-07-18 16:56:42 +02:00
committed by GitHub
parent 626a7b6a77
commit b8931311a0
2 changed files with 14 additions and 4 deletions

View File

@ -10,8 +10,15 @@ permissions:
jobs:
compute-suffix:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'build-image') }}
# This is only allowed to run if:
# - the PR branch is in the `mastodon/mastodon` repository
# - the PR is not a draft
# - the PR has the "build-image" label
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'build-image') }}
steps:
# Repository needs to be cloned so `git rev-parse` below works
- name: Clone repository
uses: actions/checkout@v3
- id: version_vars
run: |
echo mastodon_version_suffix=+pr-${{ github.event.pull_request.number }}-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT