Skip to content

[No QA] Make createNewVersion callable by anyone with write access#9879

Merged
johnmlee101 merged 8 commits into
mainfrom
Rory-FixCreateNewVersion
Jul 13, 2022
Merged

[No QA] Make createNewVersion callable by anyone with write access#9879
johnmlee101 merged 8 commits into
mainfrom
Rory-FixCreateNewVersion

Conversation

@roryabraham

@roryabraham roryabraham commented Jul 13, 2022

Copy link
Copy Markdown
Contributor

Details

The createNewVersion workflow was not being called when the actor was not OSBotify. We need it to able to = be called by anyone with write access to the repo.

Fixed Issues

$ n/a – broken deploys

Tests

  1. Validation step tested in Public-Test-Repo: https://github.com/Andrew-Test-Org/Public-Test-Repo/actions/runs/2665173073
  2. Merge this PR
  3. It should trigger a deploy

@roryabraham roryabraham self-assigned this Jul 13, 2022
@roryabraham roryabraham marked this pull request as ready for review July 13, 2022 17:28
@roryabraham roryabraham requested a review from a team as a code owner July 13, 2022 17:28
@melvin-bot melvin-bot Bot requested review from johnmlee101 and removed request for a team July 13, 2022 17:29
Comment thread .github/workflows/createNewVersion.yml Outdated
steps:
- name: Get user permissions
id: getUserPermissions
run: echo "::set-output name=PERMISSION::$(gh api /repos/Expensify/App/collaborators/roryabraham/permission | jq -r '.permission')"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this line and why it is hardcoding your user?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WHHOOOOPS good catch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And all it's doing is querying this API endpoint and then outputting the permission field of the response.

I found in my testing that I had to use a PAT instead of the regular GitHub token, which was surprising because it's just a READ endpoint. I think it must be because it's using gh api and it's not validating the actual endpoint used?

AndrewGable
AndrewGable previously approved these changes Jul 13, 2022
@roryabraham roryabraham changed the title [No QA] Lift restriction on who can call createNewVersion [No QA] Make createNewVersion callable by anyone with write access Jul 13, 2022
@roryabraham roryabraham requested a review from AndrewGable July 13, 2022 17:38
@roryabraham

Copy link
Copy Markdown
Contributor Author

Updated to use github.repository from GitHub context instead of hard-coding Expensify/App ... one less thing to change if we ever rename the repo 🤷

@johnmlee101 johnmlee101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@johnmlee101 johnmlee101 merged commit 60a0597 into main Jul 13, 2022
@johnmlee101 johnmlee101 deleted the Rory-FixCreateNewVersion branch July 13, 2022 17:47
@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.1.84-13 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants