Skip to content

Update token #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/create-pr-on-push-to-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
create-pr:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.PAT_JEST_TYPESCRIPT_EXAMPLE }}
GH_TOKEN: ${{ secrets.PAT_EXAMPLE }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -25,12 +25,12 @@ jobs:
run: |
COMMIT_SHA=$(git rev-parse HEAD)
COMMIT_TITLE=$(git log -1 --pretty=format:'%s' $COMMIT_SHA)
COMMIT_MESSAGE=$(git log -1 --pretty=format:'%b' $COMMIT_SHA)
COMMIT_MESSAGE=$(git log -1 --pretty=format:'%B' $COMMIT_SHA)
COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an' $COMMIT_SHA)
echo "commit_sha=${COMMIT_SHA}" >> $GITHUB_ENV
echo "commit_title=${COMMIT_TITLE}" >> $GITHUB_ENV
echo "commit_message=${COMMIT_MESSAGE}" >> $GITHUB_ENV
echo "commit_author=${COMMIT_AUTHOR}" >> $GITHUB_ENV
echo "${COMMIT_MESSAGE}" > commit_message.txt

- name: Map commit author to GitHub username
id: map_author
Expand All @@ -53,7 +53,7 @@ jobs:
LABEL_KEYWORDS["wontfix"]="wontfix"

COMMIT_TITLE="${{ env.commit_title }}"
COMMIT_MESSAGE="${{ env.commit_message }}"
COMMIT_MESSAGE=$(cat commit_message.txt) # Read commit message from the file

LABELS=""

Expand All @@ -70,4 +70,5 @@ jobs:
- name: Create pull request
id: create_pr
run: |
gh pr create --head ${{ env.BRANCH_NAME }} --base main -t "$commit_title" -b "$commit_message" -a "$GITHUB_USERNAME" -l "$LABELS"
COMMIT_MESSAGE=$(cat commit_message.txt) # Read commit message from the file
gh pr create --head ${{ env.BRANCH_NAME }} --base main -t "${{ env.commit_title }}" -b "$COMMIT_MESSAGE" -a "${{ env.GITHUB_USERNAME }}" -l "${{ env.LABELS }}"