Skip to content

Commit a2d9450

Browse files
committed
Updated some gh action workflows
1 parent fbec7bc commit a2d9450

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

.github/workflows/check-go-dependencies-task.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ on:
3737
jobs:
3838
run-determination:
3939
runs-on: ubuntu-latest
40+
permissions: {}
4041
outputs:
4142
result: ${{ steps.determination.outputs.result }}
4243
steps:
@@ -56,19 +57,27 @@ jobs:
5657
RESULT="false"
5758
fi
5859
59-
echo "::set-output name=result::$RESULT"
60+
echo "result=$RESULT" >> $GITHUB_OUTPUT
6061
6162
check-cache:
6263
needs: run-determination
6364
if: needs.run-determination.outputs.result == 'true'
6465
runs-on: ubuntu-latest
66+
permissions:
67+
contents: read
6568

6669
steps:
6770
- name: Checkout repository
6871
uses: actions/checkout@v4
6972
with:
7073
submodules: recursive
7174

75+
# This is required to allow jonabc/setup-licensed to install licensed via Ruby gem.
76+
- name: Install Ruby
77+
uses: ruby/setup-ruby@v1
78+
with:
79+
ruby-version: ruby # Install latest version
80+
7281
- name: Install licensed
7382
uses: jonabc/setup-licensed@v1
7483
with:
@@ -102,7 +111,7 @@ jobs:
102111
# Some might find it convenient to have CI generate the cache rather than setting up for it locally
103112
- name: Upload cache to workflow artifact
104113
if: failure() && steps.diff.outcome == 'failure'
105-
uses: actions/upload-artifact@v3
114+
uses: actions/upload-artifact@v4
106115
with:
107116
if-no-files-found: error
108117
include-hidden-files: true
@@ -113,13 +122,21 @@ jobs:
113122
needs: run-determination
114123
if: needs.run-determination.outputs.result == 'true'
115124
runs-on: ubuntu-latest
125+
permissions:
126+
contents: read
116127

117128
steps:
118129
- name: Checkout repository
119130
uses: actions/checkout@v4
120131
with:
121132
submodules: recursive
122133

134+
# This is required to allow jonabc/setup-licensed to install licensed via Ruby gem.
135+
- name: Install Ruby
136+
uses: ruby/setup-ruby@v1
137+
with:
138+
ruby-version: ruby # Install latest version
139+
123140
- name: Install licensed
124141
uses: jonabc/setup-licensed@v1
125142
with:

.github/workflows/sync-labels.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md
22
name: Sync Labels
33

4-
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
4+
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
55
on:
66
push:
77
paths:
@@ -24,6 +24,8 @@ env:
2424
jobs:
2525
check:
2626
runs-on: ubuntu-latest
27+
permissions:
28+
contents: read
2729

2830
steps:
2931
- name: Checkout repository
@@ -55,6 +57,7 @@ jobs:
5557
download:
5658
needs: check
5759
runs-on: ubuntu-latest
60+
permissions: {}
5861

5962
strategy:
6063
matrix:
@@ -71,22 +74,25 @@ jobs:
7174
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
7275

7376
- name: Pass configuration files to next job via workflow artifact
74-
uses: actions/upload-artifact@v3
77+
uses: actions/upload-artifact@v4
7578
with:
7679
path: |
7780
*.yaml
7881
*.yml
7982
if-no-files-found: error
80-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
83+
name: ${{ env.CONFIGURATIONS_ARTIFACT }}-${{ matrix.filename }}
8184

8285
sync:
8386
needs: download
8487
runs-on: ubuntu-latest
88+
permissions:
89+
contents: read
90+
issues: write
8591

8692
steps:
8793
- name: Set environment variables
8894
run: |
89-
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
95+
# See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
9096
echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV"
9197
9298
- name: Determine whether to dry run
@@ -103,21 +109,22 @@ jobs:
103109
run: |
104110
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
105111
# configuration.
106-
echo "::set-output name=flag::--dry-run"
112+
echo "flag=--dry-run" >> $GITHUB_OUTPUT
107113
108114
- name: Checkout repository
109115
uses: actions/checkout@v4
110116

111117
- name: Download configuration files artifact
112-
uses: actions/download-artifact@v3
118+
uses: actions/download-artifact@v4
113119
with:
114-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
120+
pattern: ${{ env.CONFIGURATIONS_ARTIFACT }}-*
121+
merge-multiple: true
115122
path: ${{ env.CONFIGURATIONS_FOLDER }}
116123

117124
- name: Remove unneeded artifact
118-
uses: geekyeggo/delete-artifact@v2
125+
uses: geekyeggo/delete-artifact@v5
119126
with:
120-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
127+
name: ${{ env.CONFIGURATIONS_ARTIFACT }}-*
121128

122129
- name: Merge label configuration files
123130
run: |

0 commit comments

Comments
 (0)