-
-
Notifications
You must be signed in to change notification settings - Fork 53
Closed
Description
I'm using your action in a template-repo, and when somebody uses the template, the first CI run will fail with
Could not find any tags because:
fatal: No names found, cannot describe anything.
Your action is correct. There are no tags, it's a new repo :D
The obvious workaround is to create a tag, e.g., 0.0.1.
However, I would like to propose that we can specify a default tag, e.g., 0.0.1, like this:
- name: 'Get Previous tag'
id: get_previous_tag
uses: "WyriHaximus/github-action-get-previous-tag@v1.0.1"
with:
defaultTag: "0.0.1"
- name: 'Get next patch version'
id: get_next_semver_tag
uses: "WyriHaximus/github-action-next-semvers@v1.1"
with:
version: ${{ steps.get_previous_tag.outputs.tag }}
This would require a code change here:
github-action-get-previous-tag/main.js
Lines 11 to 16 in 3f018b4
exec(`git describe --tags ${rev}`, (err, tag, stderr) => { | |
if (err) { | |
console.log('\x1b[33m%s\x1b[0m', 'Could not find any tags because: '); | |
console.log('\x1b[31m%s\x1b[0m', stderr); | |
process.exit(1); | |
} |
To respond with
console.log(`::set-output name=tag::${tag}`);
console.log(`::set-output name=timestamp::${timestamp}`);
instead of
process.exit(1);
if a default tag is set. The timestamp, in this case, could just be set to the current time.
Metadata
Metadata
Assignees
Labels
No labels