Skip to content

Commit

Permalink
Merge branch 'master' into fix_38
Browse files Browse the repository at this point in the history
  • Loading branch information
ssaunier committed Feb 16, 2023
2 parents df56dec + f602596 commit 3792837
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1.81.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7 # Not needed with a .ruby-version file
ruby-version: 3.2

- name: Cache Ruby Gems
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/standardrb-linter.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
name: StandardRB

on: [push]
on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: StandardRB Linter
uses: andrewmcodes/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUBY_VERSION: 2.7
- name: Check out the repo
uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Install StandardRB
run: gem install standard
- name: Run StandardRB
run: standardrb
20 changes: 0 additions & 20 deletions .github/workflows/wait-for-check-without-token.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/wait-on-me.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
delay_seconds:
description: "Time to delay"
required: false
default: "120"
default: "60"
push:

jobs:
Expand All @@ -18,7 +18,7 @@ jobs:
run: echo "$GITHUB_CONTEXT"
- name: Do some busywork
env:
default_delay: "120"
default_delay: "60"
input_delay: ${{ github.event.inputs.delay_seconds }}
run: |
[ "$input_delay" ] && sleep_for="$input_delay" || sleep_for="$default_delay"
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

gem "octokit", "~> 4.25"
gem "activesupport", "~> 6.1.1"
gem "faraday-retry", "~> 2.0"

group :test, :development do
gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ GEM
faraday-net_http (~> 2.0)
ruby2_keywords (>= 0.0.4)
faraday-net_http (2.0.3)
faraday-retry (2.0.0)
faraday (~> 2.0)
i18n (1.8.7)
concurrent-ruby (~> 1.0)
minitest (5.14.3)
Expand Down Expand Up @@ -72,11 +74,13 @@ GEM

PLATFORMS
x86_64-darwin-19
x86_64-darwin-22
x86_64-linux

DEPENDENCIES
activesupport (~> 6.1.1)
byebug
faraday-retry (~> 2.0)
octokit (~> 4.25)
rspec
standard
Expand Down
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:
To inspect the names as they appear to the API:

```bash
curl -i -u username:$token \
curl -u username:$token \
https://api.github.com/repos/OWNER/REPO/commits/REF/check-runs \
-H 'Accept: application/vnd.github.antiope-preview+json' | jq '[.check_runs[].name]'
```
Expand Down Expand Up @@ -220,6 +220,38 @@ jobs:
...
```

#### Using running workflow name in reusable workflows

Using this action in a reusable workflow means accepting a constraint that all calling jobs will have the same name. For example, all calling workflows must call their jobs `caller` (or some more relevant constant) so that if the reused workflow containing the job that uses this action to wait is called `callee` then the task can successfully wait on `caller / callee`. Working example follows.

.github/workflows/caller.yml

```yml
on:
push:
jobs:
caller:
uses: ./.github/workflows/callee.yml
```

.github/workflows/callee.yml

```yml
on:
workflow_call:
jobs:
callee:
runs-on: ubuntu-latest
steps:
- name: Wait for Other Workflows
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
running-workflow-name: 'caller / callee'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
```

### Allowed conclusions

By default, checks that conclude with either `success` or `skipped` are allowed, and anything else is not. You may configure this with the `allowed-conclusions` option, which is a comma-separated list of conclusions.
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ inputs:
runs:
using: "composite"
steps:
- uses: ruby/setup-ruby@v1.81.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7 # Not needed with a .ruby-version file
ruby-version: 3.2 # Not needed with a .ruby-version file

- name: Cache Ruby Gems
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ github.action_path }}
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion app/services/github_checks_verifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def wait_for_checks
fail_if_requested_check_never_run(all_checks)

until all_checks_complete(all_checks)
plural_part = all_checks.length > 1 ? "checks aren't" : "check isn't"
plural_part = (all_checks.length > 1) ? "checks aren't" : "check isn't"
puts "The requested #{plural_part} complete yet, will check back in #{wait} seconds..."
sleep(wait)
all_checks = query_check_status
Expand Down

0 comments on commit 3792837

Please sign in to comment.