This is not possible, with defaults you can only set the shell and working-directory.

You're kinda looking for default-strategy which doesn't exist. One thing to keep in mind with Github Actions is that each job is spawned on a different machine which doesn't share any information with the previous job.

What suits your needs better is to create one job with one set of strategies and multiple steps.

Answer from zzarbi on Stack Overflow
🌐
Geoffrey
geoffrey.run › computing › setting-default-values-in-github-actions-workflows
Setting Default Values in GitHub Actions Workflows
October 20, 2023 - When creating workflows, you often need to set default values for variables or parameters, especially when certain values are not always going to be provided. In this blog post, let's explore two techniques to set default values in GitHub Actions workflows, including a handy `! contains()` ...
Discussions

Dynamic default value for action inputs
As a workaround I’ve started using parameter expansion to provide default value no matter I have access to event input. I wrote quick post about it Github Action - handling input default value - DEV Community More on github.com
🌐 github.com
4
4
How to set a default value for a workflow_dispatch variable?
I want to define inputs as per workflow_dispatch with default values that are defined when using other event triggers. Beta Was this translation helpful? Give feedback. ... There was an error while loading. Please reload this page. Something went wrong. There was an error while loading. Please reload this page. ... I guess you are not alone. I need this too, in case i have branch push and i would like the values to be there. How is Github Actions ... More on github.com
🌐 github.com
7
21
How to use env variable as default value for input in github actions? - Stack Overflow
I have a github action that has an input which should have a default value based on an env.variable. Because github actions doesn't support env variables in the default field, I was wondering if I ... More on stackoverflow.com
🌐 stackoverflow.com
defaults.run.working-directory option not being respected
The GitHub Actions workflow defined the working-directory to be /.code. ... name: Pull Request on: pull_request defaults: run: working-directory: ./code jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [14.x, 16.x, 18.x] steps: - name: Checkout the Git repository uses: ... More on github.com
🌐 github.com
4
August 22, 2023
🌐
DEV Community
dev.to › mrmike › github-action-handling-input-default-value-5f2g
Github Action - handling input default value - DEV Community
January 6, 2022 - It allows you to run action with a custom name parameter. From the Github UI perspective, it looks like this · It works in a very simple way. Passed name or default value can be accessed with ${{ github.event.inputs.name }}. But the problem is that this input will be only available for jobs triggered with workflow_dispatch event.
🌐
GitHub
docs.github.com › en › actions › using-jobs › setting-default-values-for-jobs
Setting a default shell and working directory - GitHub Docs
May 12, 2023 - Use defaults to create a map of default settings that will apply to all jobs in the workflow. You can also set default settings that are only available to a job.
🌐
GitHub
github.com › defaults › defaults › actions
Actions · defaults/defaults
defaults / defaults Public · Notifications · You must be signed in to change notification settings · Fork 0 · Star 0 · Automate your workflow from idea to production · GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD.
Author   defaults
🌐
GitHub
github.com › actions › checkout
GitHub - actions/checkout: Action for checking out a repo · GitHub
High Priority bugs can be reported through Community Discussions or you can report these to our support team https://support.github.com/contact/bug-report. Security Issues should be handled as per our security.md · We will still provide security updates for this project and fix major breaking changes during this time. You are welcome to still raise bugs in this repo. Please refer to the release page for the latest release notes. - uses: actions/checkout@v6 with: # Repository name with owner. For example, actions/checkout # Default: ${{ github.repository }} repository: '' # The branch, tag or SHA to checkout.
Starred by 7.7K users
Forked by 2.5K users
Languages   TypeScript 94.4% | Shell 5.1%
Find elsewhere
🌐
GitHub
docs.github.com › actions › learn-github-actions › variables
Store information in variables - GitHub Docs
GitHub sets default variables for each GitHub Actions workflow run. You can also set custom variables for use in a single workflow or multiple workflows.
🌐
GitHub
github.blog › home › changelogs › github actions: better support for alternative default branch names
GitHub Actions: Better support for alternative default branch names - GitHub Changelog
March 22, 2025 - In addition, we have renamed the default branch for most of the GitHub-authored actions from master to main. All of your workflows that reference the old branch name will still work.
🌐
GitHub
docs.github.com › en › actions › sharing-automations › creating-actions › metadata-syntax-for-github-actions
Metadata syntax for GitHub Actions
The default value is used when an input parameter isn't specified in a workflow file. Optional If the input parameter is used, this string is logged as a warning message. You can use this warning to notify users that the input is closing down ...
🌐
GitHub
github.com › orgs › community › discussions › 46670
Set the default shell for a composite action · community · Discussion #46670
name: My action author: me description: My custom action runs: using: composite defaults: run: shell: bash steps: - name: Step 1 run: echo "step 1" - name: Step 2 run: echo "step 2"
🌐
Pablissimo
pablissimo.com › home › github actions, ternary operators and default values
GitHub Actions, ternary operators and default values – pablissimo.com
March 10, 2023 - Diagnostic logging on the action showed that inputs.readonly was ‘false’. Wait, are those quotes? Of course they are! The default value ended up being set to be a string, even though the input’s default value expression is purely boolean in nature and it’s specified as being a boolean.
🌐
GitHub
docs.github.com › actions › using-workflows › workflow-syntax-for-github-actions
Workflow syntax for GitHub Actions - GitHub Docs
For example, a default setting defined in a job will override a default setting that has the same name defined in a workflow. Use concurrency to ensure that only a single job or workflow using the same concurrency group will run at a time. A concurrency group can be any string or expression. The expression can only use github, inputs and vars contexts. For more information about expressions, see Evaluate expressions in workflows and actions.
🌐
GitHub
docs.github.com › articles › getting-started-with-github-actions
Understanding GitHub Actions - GitHub Docs
Each step is either a shell script that will be executed, or an action that will be run. Steps are executed in order and are dependent on each other. Since each step is executed on the same runner, you can share data from one step to another. For example, you can have a step that builds your application followed by a step that tests the application that was built. You can configure a job's dependencies with other jobs; by default, jobs have no dependencies and run in parallel.
🌐
GitHub
github.com › nektos › act › issues › 1982
defaults.run.working-directory option not being respected · Issue #1982 · nektos/act
August 22, 2023 - ... name: Pull Request on: pull_request defaults: run: working-directory: ./code jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [14.x, 16.x, 18.x] steps: - name: Checkout the Git repository uses: ...
Author   luisaveiro
🌐
DEV Community
dev.to › pwd9000 › github-actions-all-the-shells-581h
GitHub Actions - All the Shells - DEV Community
November 22, 2021 - When more than one default setting is defined with the same name, GitHub uses the most specific default setting. For example, a default setting defined in a job will override a default setting that has the same name defined in a workflow. ... name: my workflow on: push jobs: name-of-job: runs-on: windows-latest defaults: run: shell: pwsh steps: - name: Hello world run: | write-output "Hello World" I hope you have enjoyed this post and have learned something new. ❤️ You can find more information on action shells on the GitHub actions syntax page
🌐
GitHub
docs.github.com › en › actions
GitHub Actions documentation - GitHub Docs
You can create your own actions, or use and customize actions shared by the GitHub community.