Skip to content

Switch some secrets to variables and perform some housekeeping#4

Open
iamsophiesk wants to merge 5 commits into
mainfrom
vars-and-secrets-qol
Open

Switch some secrets to variables and perform some housekeeping#4
iamsophiesk wants to merge 5 commits into
mainfrom
vars-and-secrets-qol

Conversation

@iamsophiesk

Copy link
Copy Markdown
Contributor
  • Rearranged the input variables/secrets in workflows so that they're ordered in the same way they're used in the actual jobs.
  • Corrected some typos.
  • Added "Abort" steps for some workflows.
    • If someone enables one of the scanning workflows (eg phpstan), but it's not installed in the repo, the workflow will fail.
    • Marked it to exit if the dependency isn't installed, to hopefully make it a little clearer to people who might have enabled it without realising.
    • ... hopefully this doesn't break 😬
  • Added database/PHP version configuration to more workflows, and upgraded to PHP 8.3 as default, as this is the version used in all example workflows.
  • Switched Git user details to variables (${{ vars.GIT_NAME }} for example) instead of hardcoding them.
    • This shouldn't affect any existing workflows.
    • Updated README with more detail/information about secrets vs variables.

@iamsophiesk
iamsophiesk requested a review from a team June 25, 2026 15:47
@iamsophiesk iamsophiesk self-assigned this Jun 25, 2026
@alberto115

Copy link
Copy Markdown

Hey Sophie, just a tiny question.

Since you moved the git name and email to variables, should we set the current ones as default values for those workflows that are currently using the actions, or is the plan that it won't be set when using the latest and it will fail, so we need to set it up in all the projects currently using the actions?

It might be set already as default, but I couldn't see it in the PR.

@iamsophiesk

Copy link
Copy Markdown
Contributor Author

Hey Sophie, just a tiny question.

Since you moved the git name and email to variables, should we set the current ones as default values for those workflows that are currently using the actions, or is the plan that it won't be set when using the latest and it will fail, so we need to set it up in all the projects currently using the actions?

It might be set already as default, but I couldn't see it in the PR.

They're only variables in the example workflows, not the actual workflows :)

When you define a workflow in a codebase you'll provide the values, for example:

jobs:
  push-code:
    name: 'Deploy: push code to Pantheon.'
    uses: thisisgain/.github/.github/workflows/03-deploy-pantheon.yml@main
    with:
      # Both of these will work:
      git_name: 'GAIN Automation'
      git_email: ${{ vars.git_email }}

These are the inputs in the workflow. From 03-deploy-pantheon.yml:

on:
  workflow_call:
    inputs:
      git_name:
        description: "The Git committer name. Can be hardcoded, or get the triggering user's name."
        type: string
        required: true
      git_email:
        description: "The Git committer email. Can be hardcoded, or get the triggering user's email."
        type: string
        required: true

It doesn't matter how you pass it in - it'll accept it either way. I'm just updating the recommendation.

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