From adf615ba6c8bbefcf8e47f581e253118c692b19b Mon Sep 17 00:00:00 2001 From: Robert Fratto Date: Fri, 13 Oct 2023 08:55:51 -0400 Subject: [PATCH] add update-file.yml --- .github/workflows/update-file.yml | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/update-file.yml diff --git a/.github/workflows/update-file.yml b/.github/workflows/update-file.yml new file mode 100644 index 000000000000..47374670777f --- /dev/null +++ b/.github/workflows/update-file.yml @@ -0,0 +1,34 @@ +name: Update file +on: + workflow_dispatch: {} +permissions: + contents: write + pull-requests: write +jobs: + update-file: + runs-on: ubuntu-latest + steps: + - name: "Check out main branch" + uses: "actions/checkout@v4" + with: + ref: main + - name: "Update file" + run: | + echo "$(date)" > date.txt + - name: "Commit and push" + run: | + git config --local user.name "${GITHUB_ACTOR}" + git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com" + + #git remote add origin "https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" + + BRANCH=update-date-$(date +%s) + git checkout -b $BRANCH + + git add date.txt + git commit -m "Update date.txt" + git push origin HEAD + + gh pr create -B main --fill --reviewer "${GITHUB_ACTOR}" + env: + GH_TOKEN: ${{ github.token }}