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 GH workflow fetch #219

Closed
benjamincharity opened this issue Jul 31, 2020 · 1 comment
Closed

Fix GH workflow fetch #219

benjamincharity opened this issue Jul 31, 2020 · 1 comment

Comments

@benjamincharity
Copy link
Contributor

benjamincharity commented Jul 31, 2020

If we don't fetch back far enough to include the sha that NX will try to merge with, the workflow will fail. As a quick fix we simply fetch the last 100 commits. Since we rarely will need that many we should determine how many commits to fetch at runtime:

# This will list the number of commits since the sha (use NX base for sha)
# See other scripts for example of getting sha from previous success git tag
git rev-list --count [SHA_FROM_SUCCESS_TAG]..HEAD


$ git rev-list -n 1 last-successful-release
  505b1643ce9ce14d5cf27b24d272df7608599b09
$ git rev-list --count 505b1643ce9ce14d5cf27b24d272df7608599b09..HEAD
  0

This is probably a good time to test the method of sharing ENV vars by writing them to disc: actions/starter-workflows#68 (comment)
The nx base sha and the 'should_skip' var are both good candidates for this.

@benjamincharity
Copy link
Contributor Author

Closing for now, this doesn't seem like a viable solution. From my testing it seems that the only way to find the sha related to the last tag, is to already have that commit cloned.. so I’m going to have to fetch a bunch to find it anyway.

Also seems that the temporary file hack to share variables by writing them to temp files doesn’t work.. the file seems to disappear between steps

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

No branches or pull requests

1 participant