Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
softservedata
@softservedata
3 changes: 3 additions & 0 deletions .github/tests/Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

# Gemfile
source "https://rubygems.org"
gem "rspec"


# gem "rails"
36 changes: 36 additions & 0 deletions .github/workflows/blank.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "develop" branch
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!

# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
71 changes: 20 additions & 51 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,33 @@
# 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 }}
name: CI Pipeline

on:
push:
branches: [ main, develop ]
branches:
- main
pull_request:
branches: [ main, develop ]
workflow_dispatch:
branches:
- main

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@v4
- 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: Checkout code
uses: actions/checkout@v4

- name: Authenticate with PAT
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: echo "Authenticated using PAT"

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
working-directory: '.github/tests'
bundler-cache: true
ruby-version: 3.2

- name: Install dependencies
run: bundle install

- name: Run tests
env:
URL: ${{ github.repository }}
TOKEN: ${{ steps.my-app.outputs.token }}
working-directory: '.github/tests'
run:
ruby test/script_test.rb
run: bundle exec rspec
Loading