@@ -27,33 +27,46 @@ jobs:
27
27
# This is needed so we can determine the commits (and therefore PRs)
28
28
# where the changelogs have been added
29
29
fetch-depth : 0
30
+ # By default, the github.token is used and stored in the Git config,
31
+ # This would override any authentication provided in the URL,
32
+ # which we do later to push to a fork.
33
+ # So we need to prevent that from being stored.
34
+ persist-credentials : false
30
35
31
36
- uses : cachix/install-nix-action@v26
32
37
33
38
- name : Increment version and assemble changelog
34
39
run : |
35
40
nix-build -A autoVersion
36
41
version=$(result/bin/auto-version . ${{ github.event.pull_request.number || '' }})
37
- git config user.name ${{ github.actor }}
38
- git config user.email ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com
39
- git commit --all --message "Version $version
42
+ echo "version=$version" >> "$GITHUB_ENV"
40
43
41
- Automated release"
44
+ if [[ -n "$version" ]]; then
45
+ git config user.name ${{ github.actor }}
46
+ git config user.email ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com
47
+ git add --all
48
+ git commit --message "Version $version
42
49
43
- echo "version=$version" >> "$GITHUB_ENV"
50
+ Automated release"
51
+ fi
44
52
env :
45
53
GH_TOKEN : ${{ github.token }}
46
54
47
55
- name : Outputting draft release notes
56
+ # If we have a new version at all (it's not an empty string)
57
+ # And it's not a push event (so it's a PR),
48
58
if : ${{ env.version && github.event_name != 'push' }}
59
+ # we just output the draft changelog into the step summary
49
60
run : cat changes/released/${{ env.version }}.md > "$GITHUB_STEP_SUMMARY"
50
61
51
62
- name : Update release branch
52
- # if: ${{ env.version && github.event_name == 'push' }}
63
+ # But if this is a push te the main branch,
64
+ if : ${{ env.version && github.event_name == 'push' }}
65
+ # we push to the release branch.
53
66
# This continuously updates the release branch to contain the latest release notes,
54
67
# so that one can just merge the release branch into main to do a release.
55
68
# A PR to do that is opened regularly with another workflow
56
- run : git push origin HEAD:refs/heads/release -f
69
+ run : git push https://${{ secrets.MACHINE_USER_PAT }}@github.com/infinixbot/nixpkgs-check-by-name.git HEAD:refs/heads/release -f
57
70
58
71
59
72
test-update :
0 commit comments