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

Solve Some checks haven't completed yet issue caused by use of git-auto-commit-action #287

Merged
merged 5 commits into from
Mar 22, 2021

Conversation

mscottford
Copy link
Member

GitHub Actions are running on the commit that updates the changelog is added. This is causing some strange issues which appear to put a pull request in a strange state if there are no commits that come after the commit that modifies the changelog. Disabling the CI running on these changes should do the trick.

Here's the strange state that the pull request is getting into:
image

Here's the checks that were run on the changelog commit:
image

And here are the checks that ran on the commit that triggered the creation of the changelog:
image

Those screenshots were taken shortly after the creation of #286. This was also observed on #243, but the pull request is no longer in that state because another commit has been added.

@mscottford mscottford requested a review from mrbiggred March 20, 2021 17:54
@mscottford
Copy link
Member Author

Hmm... that did not appear to make any difference.
image

@mscottford
Copy link
Member Author

Hmm... looks like this is actually caused by the checks not running on the changelog update commit... as can be seen in the documentation for the action that's being used to create the commit.

The resulting commit will not trigger another GitHub Actions Workflow run.

mscottford and others added 2 commits March 20, 2021 14:36
The issue that I am running into is caused by the CI checks not running on the
commit that updates the change log. By using a GitHub personal access token to
interact with the GitHub API (which is what Actions uses), then I should be able
to work-around that limitation.
@mscottford
Copy link
Member Author

Looks like switching to a personal access token is going to work around this problem.

image

@mscottford mscottford changed the title Skips CI when changelog is updated Solve Some checks haven't completed yet issue caused by use of git-auto-commit-action Mar 20, 2021
@codeclimate
Copy link

codeclimate bot commented Mar 20, 2021

Code Climate has analyzed commit d9d6eb8 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 90.4%.

View more on Code Climate.

Copy link
Contributor

@mrbiggred mrbiggred left a comment

Choose a reason for hiding this comment

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

I noticed a similar issue last Friday was experimenting with a fix in #285. Your fix is working and mine isn't yet so I vote we merge yours and close mine.

I only have one question about what happens if you don't change the Auto Commit user name.

One thing we will have to watch for is that we don't have a infinite build loop since we are using a PAT. I also turned on "Allow force pushes" for the main branch. I wonder if we can get rid of that for your fix?

https://github.com/corgibytes/freshli-lib/settings/branch_protection_rules/19840660

cat CHANGELOG.md

- uses: stefanzweifel/git-auto-commit-action@v4
name: Commit Change Log and if it Changed
with:
commit_message: Committing auto generated change log.
file_pattern: CHANGELOG.md
commit_user_name: M. Scott Ford (as bot)
commit_user_email: [email protected]
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious what happens if the email does not match the PAT token account?

Copy link
Member Author

Choose a reason for hiding this comment

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

According to the discussions that I read, it has to match in order for it to actually work.

@mrbiggred mrbiggred added this to the v0.4.0 milestone Mar 22, 2021
@mrbiggred mrbiggred added the dev-ops Updates to the CI, build, etc. label Mar 22, 2021
@mscottford mscottford merged commit 316321d into main Mar 22, 2021
@mscottford mscottford deleted the skip-ci-on-changelog-updates branch March 22, 2021 19:09
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dev-ops Updates to the CI, build, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants