Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
RachalCassity committed Sep 23, 2024
1 parent 504cebc commit 3857f43
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/audit_service_tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
-c "CI=true DISABLE_BOOTSNAP=true bundle exec rake service_tags:audit_controllers_ci"
- name: Add Failure label
if: failure() && !contains(github.event.pull_request.labels.*.name, 'audit-service-failure')
if: failure()
uses: actions-ecosystem/action-add-labels@v1
with:
fail_on_error: true
Expand All @@ -107,7 +107,7 @@ jobs:
audit-service-failure
- name: Remove Failure label
if: success() && contains(github.event.pull_request.labels.*.name, 'audit-service-failure')
if: success()
uses: actions-ecosystem/action-remove-labels@v1
with:
number: ${{ github.event.pull_request.number }}
Expand Down
33 changes: 26 additions & 7 deletions .github/workflows/require_backend_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,41 @@ jobs:
# number: ${{ github.event.pull_request.number }}
# labels: |
# omit-backend-approval
- name: Requested reviewers
id: requested_reviewers
uses: actions/github-script@v6
with:
script: |
const mobileTeam = 'mobile';
const lighthouseTeam = 'lighthouse';
const identityTeam = 'identity';
const requestedTeams = await github.request('GET /repos/department-of-veterans-affairs/vets-api/pulls/${{ github.event.pull_request.number }}/requested_reviewers', {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number
}).then(response => response.data.teams.map(team => team.slug));
if (!requestedTeams.includes(mobileTeam)) {
echo "omit_backend=true" >> $GITHUB_OUTPUT
}
if (!requestedTeams.includes(lighthouseTeam)) {
echo "omit_backend=true" >> $GITHUB_OUTPUT
}
if (!requestedTeams.includes(identityTeam)) {
echo "omit_backend=true" >> $GITHUB_OUTPUT
}
- run: echo "${{ steps.requested_reviewers.outputs }}"

- name: Add omit-backend-approval label
if: |
github.event.pull_request.draft == false &&
(
contains(toJSON(github.event.pull_request.requested_teams.*.name), 'mobile') ||
contains(toJSON(github.event.pull_request.requested_teams.*.name), 'lighthouse') ||
contains(toJSON(github.event.pull_request.requested_teams.*.name), 'identity')
)
if: github.event.pull_request.draft == false && steps.requested_reviewers.outputs.omit_backend == "true"
uses: actions-ecosystem/action-add-labels@v1
with:
number: ${{ github.event.pull_request.number }}
labels: |
omit-backend-approval
- name: Add require-backend-approval label
if: github.event.pull_request.draft == false && steps.requested_reviewers.outputs.omit_backend != "true"
uses: actions-ecosystem/action-add-labels@v1
if: |
github.event.pull_request.draft == false &&
Expand Down

0 comments on commit 3857f43

Please sign in to comment.