aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatasha Pirogova <galnat@ydb.tech>2025-02-27 21:54:40 +0300
committerGitHub <noreply@github.com>2025-02-27 21:54:40 +0300
commit6c60d4658852223764506152b9425d28642b71e0 (patch)
tree6c100b68dbbf8a6f28c5776f762cc1e073e8f8ff
parent9ac8b042c59b36d9aca6c78113bf1e5e6ac04157 (diff)
downloadydb-6c60d4658852223764506152b9425d28642b71e0.tar.gz
Fix bug with permissions in update changelog scripts (#15085)
Co-authored-by: Kirill Rysin <35688753+naspirato@users.noreply.github.com>
-rw-r--r--.github/actions/update_changelog/action.yaml2
-rw-r--r--.github/actions/update_changelog/update_changelog.py6
-rw-r--r--.github/workflows/update_changelog.yml3
-rw-r--r--.github/workflows/weekly_update_changelog.yml3
4 files changed, 7 insertions, 7 deletions
diff --git a/.github/actions/update_changelog/action.yaml b/.github/actions/update_changelog/action.yaml
index 4f60517a06..aa4761d06f 100644
--- a/.github/actions/update_changelog/action.yaml
+++ b/.github/actions/update_changelog/action.yaml
@@ -40,5 +40,5 @@ runs:
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- git config --local github.token ${{ env.YDBOT_TOKEN }}
+ git config --local github.token ${{ env.GH_TOKEN }}
python ${{ github.action_path }}/update_changelog.py pr_data.txt "${{ inputs.changelog_path }}" "${{ inputs.base_branch }}" "${{ inputs.suffix }}"
diff --git a/.github/actions/update_changelog/update_changelog.py b/.github/actions/update_changelog/update_changelog.py
index 1d9250a9a2..bd80e44f43 100644
--- a/.github/actions/update_changelog/update_changelog.py
+++ b/.github/actions/update_changelog/update_changelog.py
@@ -15,7 +15,7 @@ VERSION_PREFIX = "## "
CATEGORY_PREFIX = "### "
ITEM_PREFIX = "* "
-YDBOT_TOKEN = os.getenv("YDBOT_TOKEN")
+GH_TOKEN = os.getenv("GH_TOKEN")
@functools.cache
def get_github_api_url():
@@ -152,7 +152,7 @@ def fetch_pr_details(pr_id):
url = f"https://api.github.com/repos/{get_github_api_url()}/pulls/{pr_id}"
headers = {
"Accept": "application/vnd.github.v3+json",
- "Authorization": f"token {YDBOT_TOKEN}"
+ "Authorization": f"token {GH_TOKEN}"
}
response = requests.get(url, headers=headers)
response.raise_for_status()
@@ -162,7 +162,7 @@ def fetch_user_details(username):
url = f"https://api.github.com/users/{username}"
headers = {
"Accept": "application/vnd.github.v3+json",
- "Authorization": f"token {YDBOT_TOKEN}"
+ "Authorization": f"token {GH_TOKEN}"
}
response = requests.get(url, headers=headers)
response.raise_for_status()
diff --git a/.github/workflows/update_changelog.yml b/.github/workflows/update_changelog.yml
index ac88a7a3a6..c90ade311c 100644
--- a/.github/workflows/update_changelog.yml
+++ b/.github/workflows/update_changelog.yml
@@ -39,7 +39,6 @@ jobs:
TYPE="${{ github.event.inputs.type }}"
START="${{ github.event.inputs.start }}"
BRANCH="${GITHUB_REF_NAME}"
-
echo "::notice:: branch = ${GITHUB_REF_NAME}, start = $START"
if [ "$TYPE" == "date" ]; then
@@ -86,7 +85,7 @@ jobs:
- name: Update Changelog
uses: ./.github/actions/update_changelog
env:
- YDBOT_TOKEN: ${{ secrets.YDBOT_TOKEN }}
+ GH_TOKEN: ${{ secrets.YDBOT_TOKEN }}
with:
pr_data: "${{ needs.gather-prs.outputs.prs }}"
changelog_path: "${{ github.event.inputs.changelog_path }}"
diff --git a/.github/workflows/weekly_update_changelog.yml b/.github/workflows/weekly_update_changelog.yml
index e043d83105..0bf3db35a6 100644
--- a/.github/workflows/weekly_update_changelog.yml
+++ b/.github/workflows/weekly_update_changelog.yml
@@ -5,6 +5,7 @@ on:
- cron: '0 0 * * 0' # Every Sunday at 00:00
branches:
- main
+ - stable-*
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.YDBOT_TOKEN }}
@@ -62,7 +63,7 @@ jobs:
- name: Update Changelog
uses: ./.github/actions/update_changelog
env:
- YDBOT_TOKEN: ${{ secrets.YDBOT_TOKEN }}
+ GH_TOKEN: ${{ secrets.YDBOT_TOKEN }}
with:
pr_data: "${{ needs.gather-prs.outputs.prs }}"
changelog_path: "./CHANGELOG.md" # RODO: Use the correct path to your CHANGELOG.md file