Skip to content

Commit

Permalink
first test obv not going to work
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrxyz committed Jan 8, 2025
1 parent ca5fec4 commit b62ba42
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/autopush.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,29 @@ env:
PRE_COMMIT_CACHE: ~/.cache/pre-commit

jobs:
ensure_autopusher:
name: Ensure user has autopush access
runs-on: ubuntu-latest
steps:
- name: Check autopushers team membership
uses: actions/github-script@v6
with:
github-token: ${{ secrets.INVESTIGATOR_BOT_TOKEN }}
script: |
const team = 'autopushers';
const teamResponse = await github.rest.teams.listMembersInOrg({
org: context.repo.owner,
team_slug: team,
});
const members = teamResponse.data.map((member) => member.login);
// Check if the user is a member of the team
return members.includes('notpresent');
pre-commit:
name: Run pre-commit
runs-on:
group: mala-lab-pre-commit
if: github.event.sender.login == 'cbrxyz'
if: steps.ensure_autopusher.outputs.result == 'true'
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ alias fd="fdfind"

# potentially borrowed from forrest
autopush() {
git push origin +"${1:-HEAD}":refs/heads/autopush-cameron-"$(uuidgen --random | cut -c1-8)"-citmp
git push origin +"${1:-HEAD}":refs/heads/autopush-"$USER"-"$(uuidgen --random | cut -c1-8)"-citmp
}

# ssd utils
Expand Down

0 comments on commit b62ba42

Please sign in to comment.