Repository navigation
68 lines (64 loc) · 2.77 KB
/
Copy pathwoke.yml
File metadata and controls
68 lines (64 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
# yamllint disable rule:line-length
name: Woke
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
requested:
description: Run this workflow for an authorized /citest command
required: true
type: boolean
permissions:
contents: read
pull-requests: read
# This is required for the ability to create/update the Pull request status
statuses: write
jobs:
woke:
if: inputs.requested || github.event_name != 'issue_comment'
name: Detect non-inclusive language
runs-on: ubuntu-latest
steps:
- name: Get PR head SHA and context
if: github.event_name == 'issue_comment'
id: head_sha_context
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.issue.number }}
CONTEXT: "${{ github.workflow }} / Detect non-inclusive language (pull_request)"
run: |
set -euxo pipefail
head_sha=$(gh api "repos/$REPO/pulls/$PR_NUMBER" --jq '.head.sha')
echo "head_sha=$head_sha" >> "$GITHUB_OUTPUT"
echo "context=$CONTEXT" >> "$GITHUB_OUTPUT"
- name: Set commit status as pending
if: github.event_name == 'issue_comment'
uses: linux-system-roles/.github/github-actions/commit-status@main
with:
sha: ${{ steps.head_sha_context.outputs.head_sha }}
status: pending
context: ${{ steps.head_sha_context.outputs.context }}
description: Test started
targetUrl: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ job.check_run_id }}
- name: Checkout
uses: actions/checkout@v7.0.1
with:
persist-credentials: false
ref: ${{ steps.head_sha_context.outputs.head_sha || github.sha }}
- name: Run lsr-woke-action
# Originally, uses: get-woke/woke-action@v0
uses: linux-system-roles/.github/github-actions/woke@main
with:
woke-args: "-c https://raw.githubusercontent.com/linux-system-roles/tox-lsr/main/src/tox_lsr/config_files/woke.yml --count-only-error-for-failure"
# Cause the check to fail on any broke rules
fail-on-error: true
- name: Set final commit status
if: always() && github.event_name == 'issue_comment' && steps.head_sha_context.outputs.head_sha != ''
uses: linux-system-roles/.github/github-actions/commit-status@main
with:
sha: ${{ steps.head_sha_context.outputs.head_sha }}
status: ${{ job.status }}
context: ${{ steps.head_sha_context.outputs.context }}
description: Test finished
targetUrl: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ job.check_run_id }}