Skip to content

Commit

Permalink
restore validateActor
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpersaud committed Jul 31, 2023
1 parent 299318d commit 5b155ee
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/createNewVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,18 @@ jobs:
validateActor:
runs-on: ubuntu-latest
outputs:
# TODO: fix this so we check if admin is true, as well as push
# https://docs.github.com/en/rest/apps/installations?apiVersion=2022-11-28#list-repositories-accessible-to-the-user-access-token
HAS_WRITE_ACCESS: ${{ contains(fromJSON('["write", "admin"]'), steps.getUserPermissions.outputs.PERMISSION) }}
steps:
- name: Get user permissions
id: getUserPermissions
run: echo "PERMISSION=$(gh api /users/installations/"${OS_BOTIFY_INSTALLATION_ID}"/repositories | jq -r '.repositories[].permissions')" >> "$GITHUB_OUTPUT"
run: echo "PERMISSION=$(gh api /repos/${{ github.repository }}/collaborators/${{ github.actor }}/permission | jq -r '.permission')" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: fixme
OS_BOTIFY_INSTALLATION_ID: ${{ secrets.OS_BOTIFY_INSTALLATION_ID }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}

createNewVersion:
runs-on: macos-latest
needs: validateActor
# if: ${{ fromJSON(needs.validateActor.outputs.HAS_WRITE_ACCESS) }}
if: ${{ fromJSON(needs.validateActor.outputs.HAS_WRITE_ACCESS) }}

outputs:
NEW_VERSION: ${{ steps.bumpVersion.outputs.NEW_VERSION }}
Expand Down

0 comments on commit 5b155ee

Please sign in to comment.