Version: v0.0.3
By default create-ref
uses the env-variable GITHUB_SHA
as a ref base to create a new reference. You only need set the variable refs
with the value or values separates by commas. It only accepts a git refs format.
For more information you can check this link
jobs:
job-id:
runs-on: ubuntu-latest
steps:
- name: Create a ref
uses: Hatzelencio/create-ref@v0.0.3
with:
refs: "tags/my-new-ref" # or refs: "heads/my-new-branch"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
If you need specify the sha base, you can override the sha
variable. Like the below sample:
steps:
- name: Create a ref
uses: Hatzelencio/create-ref@v0.0.3
with:
refs: "heads/my-branch,tags/my-new-tag"
sha: 8bbd7620d10bc2ac991db3d78cbcf2b868f76902
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
If you prefer, it's possible return an exit code 1
if you set the variable fail-if-ref-exists
with FORCE
. By default, this variable is set with: IGNORE
steps:
- name: Create a ref
uses: Hatzelencio/create-ref@v0.0.3
with:
refs: "heads/branch-red-already-exists"
fail-if-ref-exists: FORCE
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}