|
6 | 6 |
|
7 | 7 | jobs: |
8 | 8 | cleanup: |
9 | | - if: github.repository == 'JabRef/jabref' |
| 9 | + if: github.event.pull_request.head.repo.full_name == 'JabRef/jabref' |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | permissions: |
12 | 12 | contents: read |
13 | 13 | packages: write |
14 | 14 | steps: |
15 | | - - name: Cancel deployment run |
| 15 | + - name: Cancel workflow "binaries" run |
16 | 16 | |
17 | 17 | with: |
18 | 18 | ignore_sha: true |
19 | | - workflow_id: 9813 # workflow "Deployment" |
20 | | - - name: Check secrets presence |
21 | | - id: checksecrets |
22 | | - shell: bash |
| 19 | + workflow_id: 9160969135 |
| 20 | + - name: Cancel workflow "binaries (ea)" run |
| 21 | + |
| 22 | + with: |
| 23 | + ignore_sha: true |
| 24 | + workflow_id: 160969125 |
| 25 | + - name: "Check for 'dev: binaries' label" |
| 26 | + id: check_label |
23 | 27 | run: | |
24 | | - if [ "$BUILDJABREFPRIVATEKEY" == "" ]; then |
25 | | - echo "secretspresent=NO" >> $GITHUB_OUTPUT |
26 | | - echo "❌ Secret BUILDJABREFPRIVATEKEY not present" |
| 28 | + labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels -q '.labels[].name') |
| 29 | + if echo "$labels" | grep -Fxq "dev: binaries"; then |
| 30 | + echo "has_label_binaries=yes" >> $GITHUB_OUTPUT |
27 | 31 | else |
28 | | - echo "secretspresent=YES" >> $GITHUB_OUTPUT |
29 | | - echo "✔️ Secret BUILDJABREFPRIVATEKEY present" |
| 32 | + echo "has_label_binaries=no" >> $GITHUB_OUTPUT |
30 | 33 | fi |
31 | 34 | env: |
32 | | - BUILDJABREFPRIVATEKEY: ${{ secrets.buildJabRefPrivateKey }} |
| 35 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
33 | 36 | - name: Delete folder on builds.jabref.org |
34 | | - if: steps.checksecrets.outputs.secretspresent == 'YES' |
| 37 | + if: steps.check_label.outputs.has_label_binaries == 'yes' |
35 | 38 | |
36 | 39 | with: |
37 | 40 | script: rm -rf /var/www/builds.jabref.org/www/pull/${{ github.event.pull_request.number }} || true |
38 | 41 | host: build-upload.jabref.org |
39 | 42 | port: 9922 |
40 | 43 | username: jrrsync |
41 | 44 | key: ${{ secrets.buildJabRefPrivateKey }} |
| 45 | + - name: Get changed docker files |
| 46 | + # in line with dockerimages.yml -> lines 6 and 7 |
| 47 | + id: changed-docker-files |
| 48 | + uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46 |
| 49 | + with: |
| 50 | + # Avoid using single or double quotes for multiline patterns |
| 51 | + files: | |
| 52 | + .github/workflows/dockerimages.yml |
| 53 | + Dockerfile.* |
42 | 54 | - name: Remove Docker Tag |
| 55 | + if: steps.changed-docker-files.outputs.any_changed == 'true' |
43 | 56 | # A separate action is needed to delete a tag - see https://github.com/orgs/community/discussions/26267 |
44 | 57 | uses: rafalkk/remove-dockertag-action@v1 |
45 | 58 | with: |
|
0 commit comments