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

Support specifying the full commit message #274

Closed
dtolnay opened this issue May 3, 2020 · 5 comments
Closed

Support specifying the full commit message #274

dtolnay opened this issue May 3, 2020 · 5 comments
Assignees

Comments

@dtolnay
Copy link

dtolnay commented May 3, 2020

I am interested in using this Action, but I'd like to have complete control of the commit message of the resulting commit. The commit_message input described in https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-set-custom-commit-message allows setting a prefix of the commit message but the following code subsequently unconditionally appends the 40-character commit hash from the source commit onto that:

const hash = `${process.env.GITHUB_SHA}`;
const baseRepo = `${github.context.repo.owner}/${github.context.repo.repo}`;
if (externalRepository) {
msg = `${msg} ${baseRepo}@${hash}`;
} else {
msg = `${msg} ${hash}`;
}

Would it be possible to expose control over the full message in a way that disables appending that hash?

Tentative proposal that would work for my use case, but open to others:

uses: peaceiris/actions-gh-pages@v3
with:
  full_commit_message: ...
@peaceiris
Copy link
Owner

peaceiris commented May 3, 2020

The current specification is for using GitHub's ability to display commit hash information like the following.

Screen Shot 2020-05-04 at 7 42 55

Is there a problem with including a commit hash that fired a deployment in a commit message? Can you explain the problem in detail?
If solving that problem will improve anything, I will be happy to do so.

If we add that new feature, I'm going to implement it in the following way.

- uses: peaceiris/actions-gh-pages@v3
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    full_commit_message: ${{ github.event.head_commit.message }}

@dtolnay
Copy link
Author

dtolnay commented May 3, 2020

I am including the hash myself, except it is not at the end and it uses rev-parse --short to keep the total length under control for command line users where GitHub's displaying doesn't play a role.

# steps:

- id: rev
  run: echo ::set-output name=rev::$(git rev-parse --short HEAD)
- uses: peaceiris/actions-gh-pages@v3
  with:
    commit_message: Docs for ${{ steps.rev.outputs.rev }}: ${{ github.event.head_commit.message }}

peaceiris added a commit that referenced this issue May 4, 2020
peaceiris added a commit that referenced this issue May 4, 2020
* feat: Add full_commit_message
* ci: Add full_commit_message
* docs: Add full_commit_message

cf. #274
github-actions bot added a commit that referenced this issue May 4, 2020
* feat: Add full_commit_message
* ci: Add full_commit_message
* docs: Add full_commit_message

cf. #274
@peaceiris
Copy link
Owner

peaceiris commented May 4, 2020

The v3.6.0 has been released and the v3 tag also updated. Could you try it?

- uses: peaceiris/actions-gh-pages@v3
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    full_commit_message: ${{ github.event.head_commit.message }}

Here is an example log.

Screen Shot 2020-05-04 at 9 53 09

@dtolnay
Copy link
Author

dtolnay commented May 4, 2020

Thank you, this is perfect. I appreciate the quick fix.

@github-actions
Copy link
Contributor

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved.
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants