-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
32 lines (31 loc) · 1 KB
/
action.yml
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
name: Feature Flag Check
runs:
using: "composite"
steps:
- name: List files (for debugging)
shell: bash
run: ls -alh
- name: Check for feature flag usage
shell: bash
continue-on-error: true
run: |
chmod +x ${{github.action_path}}/ffcheck.sh
output=$(${{github.action_path}}/ffcheck.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }})
exit_code=$?
echo "$output"
if [ $exit_code -ne 0 ]; then
echo "missing_flags=$output" >> $GITHUB_ENV
fi
- name: Comment on PR
if: steps.check_flags.outputs.missing_flags
uses: actions/github-script@v6
with:
script: |
const output = `${{ steps.check_flags.outputs.missing_flags }}`;
const message = `You've not used feature flags, sort it out!\n\n${output}`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: message
})