Skip to content

Commit 682d701

Browse files
Update ruby.yml
1 parent eb5de18 commit 682d701

File tree

1 file changed

+20
-51
lines changed

1 file changed

+20
-51
lines changed

.github/workflows/ruby.yml

Lines changed: 20 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,33 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
5-
6-
# GitHub recommends pinning actions to a commit SHA.
7-
# To get a newer version, you will need to update the SHA.
8-
# You can also reference a tag or branch, but the action may change without warning.
9-
10-
name: Ruby
11-
12-
env:
13-
SECRETS_TOKEN: ${{ secrets.PAT }}
1+
name: CI Pipeline
142

153
on:
164
push:
17-
branches: [ main, develop ]
5+
branches:
6+
- main
187
pull_request:
19-
branches: [ main, develop ]
20-
workflow_dispatch:
8+
branches:
9+
- main
2110

2211
jobs:
2312
test:
2413
runs-on: ubuntu-latest
25-
14+
2615
steps:
27-
- name: Install my-app token
28-
id: my-app
29-
uses: getsentry/action-github-app-token@v3
30-
with:
31-
app_id: ${{ secrets.APP_ID }}
32-
private_key: ${{ secrets.APP_PRIVATE_KEY }}
33-
- uses: actions/checkout@v4
34-
- name: Add outside users to organization
35-
run: |
36-
users=$(curl -L -s \
37-
-H "Accept: application/vnd.github+json" \
38-
-H "Authorization: Bearer ${{ steps.my-app.outputs.token }}" \
39-
-H "X-GitHub-Api-Version: 2022-11-28" \
40-
https://api.github.com/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/collaborators?affiliation=outside \
41-
| jq '.[] .id')
42-
for user in $users
43-
do
44-
curl -s -L -o /dev/null \
45-
-X POST \
46-
-H "Accept: application/vnd.github+json" \
47-
-H "Authorization: Bearer ${{ steps.my-app.outputs.token }}" \
48-
-H "X-GitHub-Api-Version: 2022-11-28" \
49-
https://api.github.com/orgs/${{ github.repository_owner }}/invitations \
50-
-d "{\"invitee_id\": $user}"
51-
done
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Authenticate with PAT
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.PAT }}
22+
run: echo "Authenticated using PAT"
23+
5224
- name: Set up Ruby
5325
uses: ruby/setup-ruby@v1
5426
with:
55-
ruby-version: '3.2'
56-
working-directory: '.github/tests'
57-
bundler-cache: true
27+
ruby-version: 3.2
28+
29+
- name: Install dependencies
30+
run: bundle install
31+
5832
- name: Run tests
59-
env:
60-
URL: ${{ github.repository }}
61-
TOKEN: ${{ steps.my-app.outputs.token }}
62-
working-directory: '.github/tests'
63-
run:
64-
ruby test/script_test.rb
33+
run: bundle exec rspec

0 commit comments

Comments
 (0)