Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: GitHub Workflow: Docker Publish #101

Merged
merged 1 commit into from
Mar 13, 2023
Merged

fix: GitHub Workflow: Docker Publish #101

merged 1 commit into from
Mar 13, 2023

Conversation

davegudge
Copy link
Contributor

@davegudge davegudge commented Mar 10, 2023

The workflow was failing with:

The workflow is not valid. .github/workflows/docker-publish.yml (Line: 22, Col: 14): Unexpected symbol: '|'. Located at position 12 within expression: github.ref | replace('refs/tags/', '')

The set-output command is deprecated, so the issue has been fixed by utilising the github.ref_name context to retrieve the version tag that triggered the workflow.

github.ref_name: The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, feature-branch-1.

The workflow was failing with:

```
The workflow is not valid. .github/workflows/docker-publish.yml (Line: 22, Col: 14): Unexpected symbol: '|'. Located at position 12 within expression: github.ref | replace('refs/tags/', '')
```

The `set-output` command is deprecated, so the issue has been fixed by utilising the `github.ref_name` context to retrieve the version tag that triggered the workflow.

> `github.ref_name`: The short ref name of the branch or tag that triggered the workflow run. This value matches the branch or tag name shown on GitHub. For example, `feature-branch-1`.

https://docs.github.com/en/actions/learn-github-actions/contexts
Comment on lines 16 to 18
-
name: Checkout
uses: actions/checkout@v3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the docker/build-push-action docs, the "Checkout" step can also be removed from this workflow:

By default, this action [docker/build-push-action] uses the Git context, so you don't need to use the actions/checkout action to check out the repository as this will be done directly by BuildKit.

Suggested change
-
name: Checkout
uses: actions/checkout@v3

@davegudge davegudge changed the title fix: Github Workflow: Docker Publish fix: GitHub Workflow: Docker Publish Mar 10, 2023
@dhh dhh merged commit bf3d3f3 into basecamp:main Mar 13, 2023
@davegudge davegudge deleted the fix-docker-publish branch March 13, 2023 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants