From f0ea41420d59a6cb59dbf2686f299d2dc6ba1c6e Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 30 Apr 2024 11:30:14 +0100 Subject: Add an option to take the branch from the inputs --- .github/workflows/main.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 679ea65..6cb09e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,10 @@ on: - cron: "0 3 * * *" workflow_dispatch: workflow_call: + inputs: + branch: + required: true + type: string secrets: NETLIFY_TOKEN: required: true @@ -31,12 +35,20 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + # If the workflow is called from this repo, check out the branch it's called from - uses: actions/checkout@v3 + if: ${{ inputs.branch == '' }} with: repository: vyos/community.vyos.net ref: ${{ github.ref_name }} + # If the workflow is called externally, check out the branch from its inputs + - uses: actions/checkout@v3 + if: ${{ inputs.branch != '' }} + with: + repository: vyos/community.vyos.net + ref: ${{ inputs.branch }} + - name: Install build dependencies from the repos run: | echo Installing build dependencies -- cgit v1.2.3