mathieudutour / mathieudutour/github-tag-action

Failing to push refs after tag is created

Open
#118 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
733
Forks
227
PR merge metrics
No merged PRs in 30d

Description

Hi,
I'm creating a workflow that creates a new tag, generates release notes, and pushes it to the main branch. The tagging job works as expected, but when I'm trying to push the code to the branch after the tag, I'm getting:
`error: src refspec refs/heads/main matches more than one`

Here's the action.yaml file:

```yaml
name: CI
on:
push:
branches:
- main

permissions:
contents: write
jobs:
release:
runs-on: [ self-hosted ]
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Bump version
id: tag_version
uses: mathieudutour/tag-action@v6.0
with:
github_token: ${{ secrets.PUSH_TOKEN }}
default_bump: minor

- name: "✏️ Generate release changelog"
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
token: ${{ secrets.PUSH_TOKEN }}
output: CHANGELOG.md
headerLabel: "# 📑 Changelog"
breakingLabel: '### 💥 Breaking'
enhancementLabel: '### 🚀 Enhancements'
bugsLabel: '### 🐛 Bug fixes'
stripGeneratorNotice: true
issues: false
issuesWoLabels: false
pullRequests: true
prWoLabels: true
author: true
verbose: true
sinceTag: v2.25.0
- name: Commit CHANGELOG Changes
run: |
git config user.name "GitHub Actions"
git config user.email noreply@github.com
git add CHANGELOG.md
git commit -m 'Update Changelog.'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

Any idea why I cannot push new changes after the tag is created or how it should be done to work properly?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with action.yaml and the git push step after mathieudutour/tag-action@v6.0; inspect the refs after tag creation and reproduce the `src refspec refs/heads/main matches more than one` error. Done means the workflow commits CHANGELOG.md and pushes to main without the refspec error.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github-actions, yaml
Domain
ci-cd, release
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.