Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix hubConfigured for GitHub Actions #393

Merged
merged 2 commits into from
Nov 6, 2019
Merged

Conversation

eunjae-lee
Copy link
Contributor

@eunjae-lee eunjae-lee commented Nov 5, 2019

closes #316

@eunjae-lee
Copy link
Contributor Author

@uetchy Hi there,
Since I don't have access to GitHub actions, I cannot test this by myself :(
For now, the easiest way to fix this issue seems to be using hub release instead of hub api user.
What do you think?
Will this work? Could you test this for me if you don't mind?

@uetchy
Copy link
Contributor

uetchy commented Nov 6, 2019

hub release would work for verifying token but not verify it is privileged to create a release on a repository.
Checking the result of hub api repos/<user>/<repo> | jq .permissions.push might work; If it returns true, it means with provided GITHUB_TOKEN you can create a release on the repo. Perhaps it is easier to use octokit module than hub to do such a task.
Anyway I'll test this PR on my own project to see what happens.

@uetchy
Copy link
Contributor

uetchy commented Nov 6, 2019

Is it possible to publish this PR as an npm module?

https://www.pika.dev/cicd

EDIT:
Already possible with npm i algolia/shipjs#fix/gh-action

@uetchy
Copy link
Contributor

uetchy commented Nov 6, 2019

btw npm i algolia/shipjs#fix/gh-action end up failing with error: /bin/sh: 1: rollup: not found
https://github.com/vibranthq/opinionated-review/commit/50982441dfa47e49206680e5a0821dafb71cee97/checks?check_suite_id=297781477#step:6:10

EDIT:
Because prepare script is a reserved command for npm then it will be invoked when run npm install with git URL. AWESOME.
https://docs.npmjs.com/misc/scripts

EDIT:
End up cloning repo and manually build package but it finally succeeds.

- run: |
          git clone https://github.com/algolia/shipjs
          cd shipjs
          git checkout fix/gh-action
          cd packages/shipjs
          yarn install
          yarn global add file:$PWD
          echo "::add-path::$HOME/.yarn/bin"
      - run: |
          shipjs prepare

@uetchy
Copy link
Contributor

uetchy commented Nov 6, 2019

@uetchy
Copy link
Contributor

uetchy commented Nov 6, 2019

Screen Shot 2019-11-06 at 16 15 22

🚀

@eunjae-lee
Copy link
Contributor Author

hub release would work for verifying token but not verify it is privileged to create a release on a repository.
Checking the result of hub api repos/<user>/<repo> | jq .permissions.push might work; If it returns true, it means with provided GITHUB_TOKEN you can create a release on the repo. Perhaps it is easier to use octokit module than hub to do such a task.

Thanks for the test 🚀
And thanks again for the explanation.
At the moment, verifying token sounds enough and we can add code later to check if the token is privileged to create release when needed.

@eunjae-lee eunjae-lee marked this pull request as ready for review November 6, 2019 09:31
@eunjae-lee eunjae-lee merged commit 635ab7b into master Nov 6, 2019
@eunjae-lee eunjae-lee deleted the fix/gh-action branch November 6, 2019 09:34
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.

Running shipjs on GitHub Actions
2 participants