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 check order in setGithubToken #382

Merged
merged 1 commit into from
Jul 8, 2020

Conversation

sarisia
Copy link
Contributor

@sarisia sarisia commented Jul 8, 2020

In the current version, when trying to deploy to an external repository with
github_token, it fails with an inappropriate message.

Run workflow below:

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      # omitted
      - run: hugo
      - uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          external_repository: sarisia/external-repository
          publish_branch: master
          publish_dir: ./public

and get:

Setup auth token
  [INFO] setup GITHUB_TOKEN
  ##[error]Action failed with "You deploy from master to master"

I think this is inappropriate and difficult to identify the cause of failure, so
this PR changes check order in setGithubToken() to make error message more
intelligible.

@sarisia sarisia requested a review from peaceiris as a code owner July 8, 2020 19:16
@codecov
Copy link

codecov bot commented Jul 8, 2020

Codecov Report

Merging #382 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #382   +/-   ##
=======================================
  Coverage   58.33%   58.33%           
=======================================
  Files           4        4           
  Lines         240      240           
  Branches       43       43           
=======================================
  Hits          140      140           
  Misses        100      100           
Impacted Files Coverage Δ
src/set-tokens.ts 43.05% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6333d4...775e398. Read the comment docs.

Copy link
Owner

@peaceiris peaceiris left a comment

Choose a reason for hiding this comment

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

Great! Thanks

@peaceiris peaceiris merged commit 31cdbe5 into peaceiris:master Jul 8, 2020
peaceiris pushed a commit that referenced this pull request Jul 8, 2020
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.

2 participants