Skip to content

Initial commit

Initial commit #1

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Ruby
env:
SECRETS_TOKEN: ${{ secrets.PAT }}
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install my-app token
id: my-app
uses: getsentry/action-github-app-token@v3
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- uses: actions/checkout@v5
- name: Add outside users to organization
run: |
users=$(curl -L -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.my-app.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/collaborators?affiliation=outside \
| jq '.[] .id')
for user in $users
do
curl -s -L -o /dev/null \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.my-app.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/${{ github.repository_owner }}/invitations \
-d "{\"invitee_id\": $user}"
done
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
working-directory: '.github/tests'
bundler-cache: true
- name: Run tests
env:
URL: ${{ github.repository }}
TOKEN: ${{ steps.my-app.outputs.token }}
working-directory: '.github/tests'
run:
ruby test/script_test.rb