Replace hard-coded self referencing version like: example with:
In case it helps anyone, we created a composite action that implements @maxbergs's solution
https://github.com/canonical/get-workflow-version-action
Example usage:
# Reusable workflow (e.g. build_charm.yaml)
on:
workflow_call:
jobs:
foo:
runs-on: ubuntu-latest
steps:
- name: Get workflow version
id: workflow-version
uses: canonical/get-workflow-version-action@v1
with:
repository-name: canonical/data-platform-workflows
file-name: build_charm.yaml
# Use the version. For example:
- name: Install Python CLI
run: pipx install git+https://github.com/canonical/data-platform-workflows@'${{ steps.workflow-version.outputs.sha }}'#subdirectory=python/cli
Source: actions/toolkit#1264 (comment)
Replace hard-coded self referencing version like: example with:
Source: actions/toolkit#1264 (comment)