Skip to content

How to add two numbers #25386

Discussion options

You must be logged in to vote

@danielwilson1702 

Github actions doesn’t support math operations in expressions inside ${{  }}. You could add up these two numbers in bash script and then use set-env command to give its value to an environment variable, please try my example: 

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: run number with offset
env:
NUM: ${{ github.run_number }}
run: |
echo ::set-env name=GITHUB_RUN_NUMBER_WITH_OFFSET::$(($NUM+200))
- run: echo $GITHUB_RUN_NUMBER_WITH_OFFSET

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants