Skip to content

Commit 39dcc1c

Browse files
authored
Merge pull request #451 from ably/worktree-fixup-workflows
ci: GHA workflow security cleanup
2 parents b303a8e + 4673b91 commit 39dcc1c

3 files changed

Lines changed: 29 additions & 13 deletions

File tree

.github/workflows/check.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,25 @@ on:
55
branches:
66
- main
77

8+
permissions: {}
9+
810
jobs:
911
check:
1012
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
1115
strategy:
1216
fail-fast: false
1317
matrix:
1418
ruby: [ '2.7', '3.0', '3.1', '3.2', '3.3' ]
1519
protocol: [ 'json', 'msgpack' ]
1620
type: [ 'unit', 'acceptance' ]
1721
steps:
18-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
1923
with:
2024
submodules: 'recursive'
21-
- uses: ruby/setup-ruby@v1
25+
persist-credentials: false
26+
- uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
2227
with:
2328
ruby-version: ${{ matrix.ruby }}
2429
bundler-cache: true
@@ -31,8 +36,8 @@ jobs:
3136
RUBY_VERSION: ${{ matrix.ruby }}
3237
run: |
3338
mkdir junit
34-
bundle exec parallel_rspec --prefix-output-with-test-env-number --first-is-1 -- spec/${{ matrix.type }}
35-
- uses: actions/upload-artifact@v4
39+
bundle exec parallel_rspec --prefix-output-with-test-env-number --first-is-1 -- "spec/$TEST_TYPE"
40+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
3641
with:
3742
name: test-results-ruby-${{ matrix.ruby }}-${{ matrix.protocol }}-${{ matrix.type }}
3843
path: |
@@ -41,22 +46,24 @@ jobs:
4146
retention-days: 7
4247
- name: Upload test results
4348
if: always()
44-
uses: ably/test-observability-action@v1
49+
uses: ably/test-observability-action@5b61d9c59f356b83426cab1b8243dd8bf03c1bea # v1
4550
with:
4651
server-url: 'https://test-observability.herokuapp.com'
4752
server-auth: ${{ secrets.TEST_OBSERVABILITY_SERVER_AUTH_KEY }}
4853
path: 'junit/'
49-
- uses: coverallsapp/github-action@v2
54+
- uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2
5055
with:
5156
github-token: ${{ secrets.GITHUB_TOKEN }}
5257
flag-name: ruby-${{ matrix.ruby }}-${{ matrix.protocol }}-${{ matrix.type }}
5358
parallel: true
5459
finish:
5560
needs: check
5661
runs-on: ubuntu-latest
62+
permissions:
63+
contents: read
5764
steps:
5865
- name: Coveralls Finished
59-
uses: coverallsapp/github-action@v2
66+
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2
6067
with:
6168
github-token: ${{ secrets.github_token }}
6269
parallel-finished: true

.github/workflows/docs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ jobs:
1010
deployments: write
1111
id-token: write
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
14+
with:
15+
persist-credentials: false
1416

15-
- uses: ruby/setup-ruby@v1
17+
- uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
1618
with:
1719
ruby-version: '2.7'
1820
bundler-cache: true
@@ -22,14 +24,14 @@ jobs:
2224
bundle exec yard --readme INTRO.md --tag "spec:Specification"
2325
ls -al doc/
2426
- name: Configure AWS Credentials
25-
uses: aws-actions/configure-aws-credentials@v1
27+
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1
2628
with:
2729
aws-region: eu-west-2
2830
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/ably-sdk-builds-ably-ruby
2931
role-session-name: "${{ github.run_id }}-${{ github.run_number }}"
3032

3133
- name: Upload Documentation
32-
uses: ably/sdk-upload-action@v1
34+
uses: ably/sdk-upload-action@8c6179796fc7ee8fc9bb28d5223ffef005b985cc # v1
3335
with:
3436
sourcePath: doc/
3537
githubToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/features.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@ on:
66
branches:
77
- main
88

9+
permissions: {}
10+
911
jobs:
1012
build:
11-
uses: ably/features/.github/workflows/sdk-features.yml@main
13+
permissions:
14+
contents: read
15+
deployments: write
16+
id-token: write
17+
uses: ably/features/.github/workflows/sdk-features.yml@6b3fc7a8ede2ebdd7a6325314f3a96c6466f1453 # main
1218
with:
1319
repository-name: ably-ruby
14-
secrets: inherit
20+
secrets:
21+
ABLY_AWS_ACCOUNT_ID_SDK: ${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}

0 commit comments

Comments
 (0)