Skip to content
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

Merge Upstream Workflow pt. 2 #1709

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 12 additions & 1 deletion .github/workflows/check_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,31 @@ jobs:
if: github.base_ref == 'master' && github.event.pull_request.draft == false

steps:
- id: create_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- run: echo "GH_TOKEN=${{ steps.create_token.outputs.token }}" >> "$GITHUB_ENV"

- name: Downloading scripts
run: |
wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.base_ref }}/tools/changelog/changelog_utils.py
wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.base_ref }}/tools/changelog/check_changelog.py
wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.base_ref }}/tools/changelog/tags.yml

- name: Installing Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: '3.x'

- name: Installing deps
run: |
python -m pip install --upgrade pip
pip install ruamel.yaml PyGithub

- name: Changelog validation
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
GITHUB_TOKEN: ${{ env.GH_TOKEN }}
run: python check_changelog.py
30 changes: 30 additions & 0 deletions .github/workflows/master_ancestor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Check Master Merged

on:
pull_request:
branches:
- master

jobs:
check-master-merged:
runs-on: ubuntu-latest
if: github.head_ref == 'merge-upstream'

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}

- name: Fetch head branch
run: git fetch origin ${{ github.head_ref }}

- name: Check if master is merged
run: |
git checkout ${{ github.head_ref }}
if git merge-base --is-ancestor origin/${{ github.base_ref }} HEAD; then
exit 0
else
echo "Base branch is NOT merged into the head branch. Merge base branch to keep CI checks relevant."
exit 1
fi
8 changes: 5 additions & 3 deletions .github/workflows/merge_upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub googletrans==4.0.0-rc1
pip install PyGithub openai

- name: Download the script
run: |
wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/tools/changelog/changelog_utils.py
wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/tools/merge-upstream/merge_upstream.py
wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/tools/merge-upstream/translation_context.txt

- name: Run the script
env:
Expand All @@ -39,9 +40,10 @@ jobs:
UPSTREAM_REPO: 'ParadiseSS13/Paradise'
UPSTREAM_BRANCH: 'master'
MERGE_BRANCH: 'merge-upstream'
TRANSLATE_CHANGES: 'true'
CHANGELOG_AUTHOR: 'ParadiseSS13'
TRANSLATE_CHANGES: 'true'
OPENAI_API_KEY: ${{ secrets.ORG_EMPTY_TOKEN }}
run: |
git config --global user.email "action@github.com"
git config --global user.name "Upstream Sync"
python3 merge_upstream.py
python3 -u merge_upstream.py
Loading
Loading