Questions tagged [building-github-actions]

Questions should be tagged with building-github-actions if the question is about creating custom actions like the examples in https://github.com/actions. Questions should not be tagged with this tag if the question is about using GitHub actions/writing GitHub Actions yml files.

From the documentation:

Actions are individual tasks that you can combine to create jobs and customize your workflow. You can create your own actions, and use and customize actions shared by the GitHub community.

There are some sample actions here but this tag is about building own actions.

Currently, there are 2 types of actions:

177 questions
87
votes
6 answers

Push to origin from GitHub action

I'm trying to push to origin remote from GitHub action. The logic of my action is: handle pull_request_review events and filter by comment message checkout to master, merge PR branch, run some checks and push it to origin The script is: if [[…
Kirill
  • 7,580
  • 6
  • 44
  • 95
36
votes
1 answer

Dropdown for GitHub Workflows input parameters

I want to create a dropdown list for my GitHub Action Input parameter. This should help in selecting a value from the dropdown just like how the option is there to select the branches.
vik_nag
  • 415
  • 1
  • 5
  • 7
36
votes
5 answers

How do I make a GitHub Action matrix element conditional?

I have a workflow that uses 'strategy' = 'matrix' along with a list of specific configurations to build. Here is my workflow file: # # build-N-test-v2.1-Dev and build-N-test-v2.1-Release are nearly # identical, but a few tests are commented out (to…
lewis
  • 1,116
  • 1
  • 12
  • 28
25
votes
2 answers

GitHub Actions: Required property is missing: shell

Introduction I am currently to crate a composite GitHub Actions that build a JavaDoc from Java project and publish it automatically to a static page with GitHub Page. Problematic But I got this error when I try to run it: Current runner version:…
ThrowsError
  • 1,169
  • 1
  • 11
  • 43
25
votes
2 answers

How to check for a label in a github action condition

Let's say I have a github action like this: name: My Action on: pull_request: types: - closed jobs: myjob: runs-on: ubuntu-latest name: Test if: github.event.pull_request.merged && XXX I would like to have a condition…
Denis Rouzaud
  • 2,412
  • 2
  • 26
  • 45
20
votes
1 answer

How can I use a Github action's output in a workflow?

Let's take this example composite action found on Github's documentation: name: 'Hello World' description: 'Greet someone' inputs: who-to-greet: # id of input description: 'Who to greet' required: true default: 'World' outputs: …
Maslor
  • 1,821
  • 3
  • 20
  • 44
20
votes
4 answers

How to perform string manipulation while declaring env vars in GitHub Actions

I have a github repository like the following johndoe/hello-world I am trying to set the following environment variables in github actions env: DOCKER_HUB_USERID: ${{ github.actor }} REPOSITORY_NAME: ${GITHUB_REPOSITORY#*\/} …
18
votes
4 answers

How to cache docker-compose build inside github-action

Is there any way to cache docker-compose so that it will not build again and again? here is my action workflow file: name: Github Action on: push: branches: - staging jobs: test: runs-on: ubuntu-18.04 steps: - uses:…
11
votes
3 answers

Environment variables in github actions

I want to pass maven image version as as env variable but when i am trying to access that env.MAVEN_VERSION variable getting error Error- The workflow is not valid. .github/workflows/Merge.yaml (Line: 13 image:) Unrecognized named-value: 'env'.…
11
votes
1 answer

Github Action Trigger on multiple on: push: paths

In single repo, I want to create more than one trigger for different paths [paths: 'frontend/**' and paths: 'backend/**'] with different parameters for (same) build jobs. Following are the two workflow. name: Trigger Jenkins Build [ Build-Portal…
roy
  • 6,344
  • 24
  • 92
  • 174
11
votes
3 answers

GitHub Actions: env: Use pre-defined environment variables on RHS within env section

I would like to declare some environment variables in a top level env section in my main.yml whose values use some pre-defined environment variables such as those documented in the GitHub Actions documentation. However, it appears I cannot use…
edburns
  • 482
  • 1
  • 4
  • 13
10
votes
2 answers

How to know what version of a GitHub Action to use

I've noticed in various GitHub Action workflow examples, often when calling a pre-defined action (with the uses: syntax) then a particular version of that action is specified. For example: steps: - uses: actions/checkout@v2 - name: Set up…
Daniel Goldfarb
  • 6,937
  • 5
  • 29
  • 61
9
votes
1 answer

In a GitHub Action how to conditionalize a step based off the previous step's output?

Building a GitHub action based on the commit message I'm trying to base a step on whether the commit message contains a particular string, set it to a variable and then in the next step check with a condition. My current implementation of my action…
DᴀʀᴛʜVᴀᴅᴇʀ
  • 7,681
  • 17
  • 73
  • 127
9
votes
4 answers

Why The Action Cannot Access Secrets?

I am trying to create a workflow to deploy Nuget packages to Github Package Repository using Github Actions. In this case, The repository is inside an organization I am the owner of that organization I have admin access to the repository The…
Shanaka Rusith
  • 421
  • 1
  • 4
  • 19
8
votes
1 answer

Can we directly write Python code under "run | " section in action.yml file

In GitHub Actions, can we directly write python code under run | -section in action.yml file? Can I write GitHub Actions scripts in Python?
Shiva
  • 91
  • 1
  • 3
1
2 3
11 12