diff --git a/.github/workflows/github-repository-commit.yml b/.github/workflows/github-repository-commit.yml index 1c62741..97b0aaa 100644 --- a/.github/workflows/github-repository-commit.yml +++ b/.github/workflows/github-repository-commit.yml @@ -30,20 +30,21 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Edit a file + if: github.event.inputs.edit + run: | + echo -e "\n" >> README.md + date >> README.md - name: Prepare a branch, and file id: commit-step run: | - if "${{ github.event.inputs.edit }}"; then - echo -e "\n" >> README.md - date >> README.md - fi git checkout -b $HEAD_BRANCH git config user.name github-actions[bot] git config user.email 41898282+github-actions[bot]@users.noreply.github.com git add . git commit -m "Add date to README.md" git push --set-upstream origin $HEAD_BRANCH - # git checkout main + git checkout $BASE_BRANCH echo "base-branch-name: $BASE_BRANCH" echo "base-branch-name=$BASE_BRANCH" >> $GITHUB_OUTPUT echo "head-branch-name: $HEAD_BRANCH"