Skip to content

Commit

Permalink
Merge pull request #6 from senthil10/develop
Browse files Browse the repository at this point in the history
Test action
  • Loading branch information
senthil10 authored Apr 4, 2024
2 parents 891fb9c + a223ae6 commit 0f36c47
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 40 deletions.
62 changes: 22 additions & 40 deletions .github/workflows/test_action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,32 @@ on:
push:
branches:
- main
- develop
release:
types: [published]

jobs:
one:
update_index_file:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Dump strategy context
env:
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
run: echo "$STRATEGY_CONTEXT"
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
- name: Dump output context
env:
OUTPUT_CONTEXT: ${{ toJson(steps.meta.outputs) }}
run: echo "$OUTPUT_CONTEXT"
- name: Show set env variable
env:
HUGO_ENV: ${{ github.ref_name == 'main' && 'production' || github.event_name == 'release' && 'production' || 'development' }}
run: echo "The hugo env is - $HUGO_ENV"
- name: Show custom variables
- name: Check out the repo
uses: actions/checkout@v3
with:
ref: develop
- name: Set local git config
run: |
git branch
git config --local user.name ${{ github.actor }}
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
- name: Update the file and push to develop
run: |
echo "This is Hugo env - ${{ github.event_name == 'release' && format('{0}-{1}', 'production', github.ref_name)
|| github.ref_name == 'main' && format('{0}-{1}', 'production', github.sha)
|| format('{0}-{1}', 'development', github.sha) }}"
echo "This is what the version is ${{ github.event_name == 'release' && github.ref_name || github.sha }}"
echo "The git ref name is: ${{ github.ref_name }}"
echo "This is a test file" > test_file.txt
git add test_file.txt
git commit -m "Action file update"
git push origin develop
- name: Make pull request to main branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr create --base main --head develop --title "Action PR" --body "Updating the file"
1 change: 1 addition & 0 deletions test_file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a test file created

0 comments on commit 0f36c47

Please sign in to comment.