release.yml: Fix tag protection not being recognized in workflow

This commit is contained in:
thecalcaholic 2022-08-15 21:49:09 +02:00
parent 712b6f9d37
commit cb70d2f953
2 changed files with 12 additions and 12 deletions

View File

@ -130,7 +130,7 @@ jobs:
# --silent # --silent
set_update_label: set_update_label:
if: ${{ github.event_name == 'issue_comment' && ! contains( github.event.issue.assignees.*.login, github.event.comment.user.login ) }} if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request && !contains( github.event.issue.assignees.*.login, github.event.comment.user.login ) }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Add update label to issue - name: Add update label to issue

View File

@ -138,7 +138,7 @@ jobs:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.lxd.outputs.artifact_name }}" artifact_id: "${{ needs.lxd.outputs.artifact_name }}"
artifact_file: "${{ needs.lxd.outputs.artifact_file }}" artifact_file: "${{ needs.lxd.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !github.ref_protected }} dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit secrets: inherit
raspberrypi-release: raspberrypi-release:
@ -151,7 +151,7 @@ jobs:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.raspberrypi.outputs.artifact_name }}" artifact_id: "${{ needs.raspberrypi.outputs.artifact_name }}"
artifact_file: "${{ needs.raspberrypi.outputs.artifact_file }}" artifact_file: "${{ needs.raspberrypi.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !github.ref_protected }} dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit secrets: inherit
odroidxu4-release: odroidxu4-release:
@ -164,7 +164,7 @@ jobs:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.odroidxu4.outputs.artifact_name }}" artifact_id: "${{ needs.odroidxu4.outputs.artifact_name }}"
artifact_file: "${{ needs.odroidxu4.outputs.artifact_file }}" artifact_file: "${{ needs.odroidxu4.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !github.ref_protected }} dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit secrets: inherit
rockpro64-release: rockpro64-release:
needs: needs:
@ -176,7 +176,7 @@ jobs:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.rockpro64.outputs.artifact_name }}" artifact_id: "${{ needs.rockpro64.outputs.artifact_name }}"
artifact_file: "${{ needs.rockpro64.outputs.artifact_file }}" artifact_file: "${{ needs.rockpro64.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !github.ref_protected }} dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit secrets: inherit
rock64-release: rock64-release:
needs: needs:
@ -188,7 +188,7 @@ jobs:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.rock64.outputs.artifact_name }}" artifact_id: "${{ needs.rock64.outputs.artifact_name }}"
artifact_file: "${{ needs.rock64.outputs.artifact_file }}" artifact_file: "${{ needs.rock64.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !github.ref_protected }} dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit secrets: inherit
bananapi-release: bananapi-release:
needs: needs:
@ -200,7 +200,7 @@ jobs:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.bananapi.outputs.artifact_name }}" artifact_id: "${{ needs.bananapi.outputs.artifact_name }}"
artifact_file: "${{ needs.bananapi.outputs.artifact_file }}" artifact_file: "${{ needs.bananapi.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !github.ref_protected }} dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit secrets: inherit
odroidhc4-release: odroidhc4-release:
needs: needs:
@ -212,7 +212,7 @@ jobs:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.odroidhc4.outputs.artifact_name }}" artifact_id: "${{ needs.odroidhc4.outputs.artifact_name }}"
artifact_file: "${{ needs.odroidhc4.outputs.artifact_file }}" artifact_file: "${{ needs.odroidhc4.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !github.ref_protected }} dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit secrets: inherit
odroidc4-release: odroidc4-release:
needs: needs:
@ -224,7 +224,7 @@ jobs:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.odroidc4.outputs.artifact_name }}" artifact_id: "${{ needs.odroidc4.outputs.artifact_name }}"
artifact_file: "${{ needs.odroidc4.outputs.artifact_file }}" artifact_file: "${{ needs.odroidc4.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !github.ref_protected }} dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit secrets: inherit
odroidc2-release: odroidc2-release:
needs: needs:
@ -236,14 +236,14 @@ jobs:
git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}" git_ref: "${{ inputs.git_ref || github.head_ref || github.ref_name }}"
artifact_id: "${{ needs.odroidc2.outputs.artifact_name }}" artifact_id: "${{ needs.odroidc2.outputs.artifact_name }}"
artifact_file: "${{ needs.odroidc2.outputs.artifact_file }}" artifact_file: "${{ needs.odroidc2.outputs.artifact_file }}"
dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !github.ref_protected }} dry_run: ${{ (!inputs.release && github.event_name == 'workflow_dispatch') || github.ref_type != 'tag' || !(github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
secrets: inherit secrets: inherit
docker-release: docker-release:
needs: needs:
- docker - docker
- test-curl-installer - test-curl-installer
if: ${{ (inputs.release || github.event_name != 'workflow_dispatch') && github.ref_type == 'tag' && github.ref_protected }} if: ${{ (inputs.release || github.event_name != 'workflow_dispatch') && github.ref_type == 'tag' && (github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Login to DockerHub - name: Login to DockerHub
@ -306,7 +306,7 @@ jobs:
echo "ref type: ${{ github.ref_type }}" echo "ref type: ${{ github.ref_type }}"
echo "protected?: ${{ github.ref_protected }}" echo "protected?: ${{ github.ref_protected }}"
- name: Create Draft - name: Create Draft
if: ${{ (inputs.release || github.event_name != 'workflow_dispatch') && github.ref_type == 'tag' && github.ref_protected }} if: ${{ (inputs.release || github.event_name != 'workflow_dispatch') && github.ref_type == 'tag' && (github.ref_protected || startsWith(github.ref, 'refs/tags/v')) }}
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./release working-directory: ./release