You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to build only the affected apps when I create a new tag. The problem is that on a tag the last commit is only zeros. Is it possible that this works? My workaround is to build everything. :/
Expected behavior
Build only the affected apps.
Output
$ nx affected --target=lint --base=0000000000000000000000000000000000000000 --head=6cb6624933ed92b53c116d2271b23af57916b70a
fatal: Not a valid commit name 0000000000000000000000000000000000000000
fatal: No such ref: '0000000000000000000000000000000000000000'
The text was updated successfully, but these errors were encountered:
I needed something similiar.... I needed to get all changes since the last tag which isn't necesarily HEAD~1. So I just added a PR that will allow you to specify the base commit hash, which you can use when you find the last tag commit hash.... so this is how I am currently using it (just FYI, my version 'dkhunt27/[email protected]' does exist now, but I will delete that once my PR is merged to this repo)
- name: Determine base commit hash (find last release/tag)
run: |
# if you need to use a specific version
# git log --oneline --grep="chore(release): v0.1.6" -n1
# PREVIOUS_TAG_HASH=`git log --oneline --grep="chore(release): v0.1.6" -n1 | cut -d ' ' -f1`
git --no-pager log --oneline $(git describe --tags --abbrev=0) -n1
PREVIOUS_TAG_HASH=`git --no-pager log --oneline $(git describe --tags --abbrev=0) -n1 | cut -d ' ' -f1`
echo "PREVIOUS_TAG_HASH=$PREVIOUS_TAG_HASH" >> $GITHUB_ENV
- name: Build (Nx Affected)
uses: dkhunt27/[email protected]
with:
targets: build
affected: true
affectedBaseNonPR: ${{ env.PREVIOUS_TAG_HASH }} # need to go back to last release/tag
nxCloud: false
Sorry for this long time, I've been really busy quite recently. I've lookup at GitHub's documentation, and I'm surprised there is no GitHub Actions event when a tag is created, which could exposes the information that @dkhunt27 fetch manually. I'm not against bundling this logic into the action, but I don't think I will have the time to implement this myself. For now.
I see that a PR was already opened by @dkhunt27, I will take a look at it shortly :)
Bug Report
Current behavior
I want to build only the affected apps when I create a new tag. The problem is that on a tag the last commit is only zeros. Is it possible that this works? My workaround is to build everything. :/
Expected behavior
Build only the affected apps.
Output
The text was updated successfully, but these errors were encountered: