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

Allow testing of CLI changes from a branch #134

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/actions/install-languages-cli/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ name: Install Languages CLI
description: Downloads the Languages CLI from a known release or installs using Cargo

inputs:
branch:
colincasey marked this conversation as resolved.
Show resolved Hide resolved
# This input is currently the only way we can modify which branch to install the CLI tooling from. Ideally we
# would be able to use [`job_workflow_sha`](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context)
# and always install from the same branch as the workflow but, due to a [bug](https://github.com/actions/runner/issues/2417)
# in the GitHub Action runner, the value is never populated :(
required: false
description: The branch to install the CLI from (only used when `download_url` is not provided)
default: main
download_url:
required: false
description: The url to download the CLI binary from
Expand All @@ -22,7 +30,7 @@ runs:
- name: Build actions binary
shell: bash
if: inputs.download_url == ''
run: cargo install --locked --git https://github.com/heroku/languages-github-actions.git
run: cargo install --locked --git https://github.com/heroku/languages-github-actions.git --branch ${{ inputs.branch }}

- name: Download actions binary
shell: bash
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/_buildpacks-prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ on:
type: string
required: false
default: pub-hk-ubuntu-22.04-small
languages_cli_branch:
colincasey marked this conversation as resolved.
Show resolved Hide resolved
description: The branch to install the Languages CLI from (FOR TESTING)
type: string
required: false
default: main
secrets:
app_private_key:
description: Private key of GitHub application (Linguist)
Expand Down Expand Up @@ -67,6 +72,8 @@ jobs:

- name: Install Languages CLI
uses: heroku/languages-github-actions/.github/actions/install-languages-cli@main
with:
branch: ${{ inputs.languages_cli_branch }}

- name: Bump versions and update changelogs
id: prepare
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/_buildpacks-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ on:
type: string
required: false
default: pub-hk-ubuntu-22.04-small
languages_cli_branch:
description: The branch to install the Languages CLI from (FOR TESTING)
type: string
required: false
default: main
secrets:
app_private_key:
description: Private key of GitHub application (e.g. the Linguist App)
Expand Down Expand Up @@ -78,6 +83,7 @@ jobs:
- name: Install Languages CLI
uses: heroku/languages-github-actions/.github/actions/install-languages-cli@main
with:
branch: ${{ inputs.languages_cli_branch }}
update_rust_toolchain: false

- name: Package buildpacks
Expand Down Expand Up @@ -295,6 +301,8 @@ jobs:

- name: Install Languages CLI
uses: heroku/languages-github-actions/.github/actions/install-languages-cli@main
with:
branch: ${{ inputs.languages_cli_branch }}

- name: Update Builder
# The dry run check is performed here because the update process requires a published
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Before using the shared workflows below, please be sure to configure the followi
to **Allow auto-merge**.

> If either of these settings are misconfigured you will encounter errors during steps that
> create or configure pull requests. For example, an error message of **"Pull request User is
> create or configure pull requests. For example, an error message of **"Pull request User is
> not authorized for this protected branch"** indicates the branch protection rules are missing
> the GitHub Application bot user.

Expand Down Expand Up @@ -77,6 +77,7 @@ jobs:
| `bump` | Which component of the version to increment (major, minor, or patch) | true | |
| `declarations_starting_version` | Only needed if existing releases have been published but there is no matching release tag in Git. If this is the case, the first git tag that matches a version from your CHANGELOG should be supplied. | false | |
| `ip_allowlisted_runner` | The GitHub Actions runner to use to run jobs that require IP allow-list privileges | false | `pub-hk-ubuntu-22.04-small` |
| `languages_cli_branch` | The branch to install the Languages CLI from (FOR TESTING) | false | `main` |

#### Secrets

Expand Down Expand Up @@ -136,6 +137,7 @@ jobs:
| `app_id` | Application ID of GitHub application (e.g. the Linguist App) | true | |
| `dry_run` | Flag used for testing purposes to prevent actions that perform publishing operations from executing | false | false |
| `ip_allowlisted_runner` | The GitHub Actions runner to use to run jobs that require IP allow-list privileges | false | `pub-hk-ubuntu-22.04-small` |
| `languages_cli_branch` | The branch to install the Languages CLI from (FOR TESTING) | false | `main` |

#### Secrets

Expand Down