Delete model-metadata/teamsix-testmodel1.yaml #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update authorized users | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- 'model-metadata/*.yaml' | |
jobs: | |
update-users-list: | |
if: ${{ github.repository_owner == 'CDCgov' }} | |
runs-on: ubuntu-22.04 | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
install-r: false | |
use-public-rspm: true | |
- name: Install dependencies | |
run: | | |
install.packages(c("yaml", "purrr")) | |
shell: Rscript {0} | |
- name: generate users list | |
run: | | |
Rscript src/code/get_authorized_users.r | |
- name: Check for Changes | |
id: check_diff | |
run: | | |
git diff --exit-code src/code/authorized_users.txt || echo "changed=true" >> $GITHUB_ENV | |
- name: Commit changes | |
if: env.changed == 'true' | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: "Update authorized users" | |
default_author: github_actions | |
push: true | |
new_branch: update-authorized-users | |
- name: Create pull request | |
if: env.changed == 'true' | |
run: | | |
gh pr create --base main --head update-authorized-users --title "Update authorized users" --body "This PR updates the authorized users list based on the latest metadata." | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |