diff --git a/.github/workflows/random.yaml b/.github/workflows/random.yaml index 85a4328..075385c 100644 --- a/.github/workflows/random.yaml +++ b/.github/workflows/random.yaml @@ -10,3 +10,15 @@ jobs: steps: - name: Echo Message run: echo "Workflow manually triggered." + + - name: Set branch name + run: | + echo "BRANCH_NAME=$(echo "${{ github.ref }}" | sed 's#refs/heads/##')" >> $GITHUB_ENV + + - name: Create file with content + run: | + mkdir -p test + cd test + echo "hello" > testing-file-touch-${{ env.BRANCH_NAME }}.txt + + diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9ec945b..c23fe13 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,14 +1,15 @@ -name: Manual Trigger Workflow +name: Manual Trigger Workflow run on: - create: - paths: - - '.github/workflows/random.yaml' - + workflow_run: + workflows: [Manual Trigger Workflow] + types: + - completed jobs: build: runs-on: ubuntu-latest steps: - - name: Echo Message - run: echo "Workflow manually triggered." + - name: Echo Message copy fuile + run: | + cp touch testing-file-touch-${{ github.event.workflow_run.head_branch }}.txt new.txt diff --git a/testing-file-touch-testing-branch.txt b/testing-file-touch-testing-branch.txt new file mode 100644 index 0000000..7a30dec --- /dev/null +++ b/testing-file-touch-testing-branch.txt @@ -0,0 +1 @@ +testing-file-touch-testing-branch.txt hello