-
Notifications
You must be signed in to change notification settings - Fork 2
fix(actions): install CLI via raw URL, not github.action_path #30
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,16 @@ runs: | |
| if: ${{ inputs.run-codegen == 'true' }} | ||
| id: install | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+73
to
+74
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
| | bash -s -- | ||
|
|
||
| - name: Layered codegen | ||
| if: ${{ inputs.run-codegen == 'true' }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,16 @@ runs: | |
|
|
||
| - id: install | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+50
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
| | bash -s -- | ||
|
|
||
| - shell: bash | ||
| env: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,7 +90,16 @@ runs: | |
| - id: install | ||
| if: ${{ inputs.to-s3 == 'true' }} | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+93
to
+94
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
| | bash -s -- | ||
|
|
||
| - id: s3 | ||
| if: ${{ inputs.to-s3 == 'true' }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,16 @@ runs: | |
| - name: Install flutter-tools CLI | ||
| id: install | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+74
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When consumers pin a mutable action ref such as Useful? React with 👍 / 👎. |
||
| | bash -s -- | ||
|
|
||
| - name: Run layered codegen | ||
| shell: bash | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,4 +23,13 @@ runs: | |
| steps: | ||
| - id: install | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" "${{ inputs.version }}" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+26
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a workflow consumes this action from a fork or from a ref/SHA that only exists outside Useful? React with 👍 / 👎. |
||
| | bash -s -- "${{ inputs.version }}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,7 +43,16 @@ runs: | |
| steps: | ||
| - id: install | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+46
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
| | bash -s -- | ||
|
|
||
| - id: build | ||
| shell: bash | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,16 @@ runs: | |
| if: ${{ inputs.run-codegen == 'true' }} | ||
| id: install | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+56
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
| | bash -s -- | ||
|
|
||
| - name: Layered codegen | ||
| if: ${{ inputs.run-codegen == 'true' }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,16 @@ runs: | |
|
|
||
| - id: install | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+53
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
| | bash -s -- | ||
|
|
||
| - name: Upload to Play | ||
| shell: bash | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,16 @@ runs: | |
| steps: | ||
| - id: install | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
| | bash -s -- | ||
|
|
||
| - id: compute | ||
| shell: bash | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,16 @@ runs: | |
| steps: | ||
| - id: install | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+63
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
| | bash -s -- | ||
|
|
||
| - id: shots | ||
| shell: bash | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,16 @@ runs: | |
|
|
||
| - id: install | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+37
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
| | bash -s -- | ||
|
|
||
| - shell: bash | ||
| env: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,16 @@ runs: | |
| # step so its $GITHUB_OUTPUT path is readable by the stamp step below. | ||
| - id: install | ||
| shell: bash | ||
| run: bash "${{ github.action_path }}/../../scripts/install-cli.sh" | ||
| env: | ||
| FT_REF: ${{ github.action_ref }} | ||
|
Comment on lines
+43
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing), env:
FT_REF: ${{ github.action_ref || github.sha }} |
||
| run: | | ||
| set -euo pipefail | ||
| # github.action_path is NOT translated into the container by the GH | ||
| # runner under podman → a path-based call ENOENTs. Fetch the installer | ||
| # from the pinned ref (container/runtime-agnostic). | ||
| curl --fail --silent --show-error --location --retry 3 \ | ||
| "https://raw.githubusercontent.com/vymalo/flutter-tools/${FT_REF}/scripts/install-cli.sh" \ | ||
| | bash -s -- | ||
| - id: stamp | ||
| shell: bash | ||
| env: | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,12 +16,28 @@ set -euo pipefail | |||||
|
|
||||||
| REPO="vymalo/flutter-tools" | ||||||
|
|
||||||
| script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||||||
| repo_root="$(cd "$script_dir/.." && pwd)" | ||||||
| # When piped from stdin (curl | bash) there is no on-disk checkout, so BASH_SOURCE | ||||||
| # is unreliable — fall back to "." and guard every repo-relative read below. | ||||||
| script_dir="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" 2>/dev/null && pwd || echo .)" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When
Suggested change
|
||||||
| repo_root="$(cd "$script_dir/.." 2>/dev/null && pwd || echo .)" | ||||||
|
|
||||||
| # Last-resort version when neither an arg, CLI_VERSION, an on-disk cli-version.txt, | ||||||
| # nor FT_REF is available. Keep in sync with cli-version.txt. | ||||||
| DEFAULT_CLI_VERSION="0.1.0" | ||||||
|
|
||||||
| # Version precedence: explicit arg / CLI_VERSION → on-disk cli-version.txt (normal | ||||||
| # checkout) → cli-version.txt fetched from the action ref (curl-pipe; FT_REF set by | ||||||
| # the calling action = github.action_ref) → baked default. | ||||||
| version="${1:-${CLI_VERSION:-}}" | ||||||
| if [ -z "$version" ]; then | ||||||
| version="$(tr -d ' \t\n\r' < "$repo_root/cli-version.txt")" | ||||||
| if [ -f "$repo_root/cli-version.txt" ]; then | ||||||
| version="$(tr -d ' \t\n\r' < "$repo_root/cli-version.txt")" | ||||||
| elif [ -n "${FT_REF:-}" ]; then | ||||||
| version="$(curl --fail --silent --show-error --location --retry 3 \ | ||||||
| "https://raw.githubusercontent.com/${REPO}/${FT_REF}/cli-version.txt" | tr -d ' \t\n\r')" | ||||||
| else | ||||||
| version="$DEFAULT_CLI_VERSION" | ||||||
| fi | ||||||
| fi | ||||||
| # Tolerate a leading `cli-v` / `v` so `v0.1.0` or `cli-v0.1.0` also resolve. | ||||||
| version="${version#cli-v}" | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the action is run within the same repository (such as in the repository's own CI/CD workflows or during local testing),
github.action_refis empty. This causes thecurlcommand to attempt to fetch from an invalid URL (with a double slash and no ref), resulting in a 404 error and failing the step. Falling back togithub.shawhengithub.action_refis empty ensures that the action remains functional and always fetches the correct version of the script corresponding to the commit being tested.