nx-tools
nx-tools copied to clipboard
nx-docker, metadata github branches and slash commands
trafficstars
We use slash commands to build the docker containers and deploy, and we are hitting this:
On a github action on the 'main' brach, we do the following
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.pull_request.head.ref }}
fetch-depth: 0
The PR branch is checked out e.g. roderik/test
But the following tag setup
"tags": [
"type=schedule",
"type=ref,event=branch",
"type=ref,event=tag",
"type=ref,event=pr",
"type=sha,format=long,prefix={{branch}}-",
"type=sha,format=long",
"type=raw,value=development"
]
uses the main branch as a branchname. As far as I understand the ci-context package, it gets the branch from github metadata which is usually correct, but not in this case.
Is there a way to override the "branch" from an environment variable of sorts?
ps. we use v2
@roderik hi, there is no way to do that :(
Currently GitHub provider relies only in the response of the octokit client, but gitlab and the other providers relies on env variables