Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions .github/fork-specific-files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.github/dependabot.yml
.github/workflows/codacy.yml
.github/workflows/codeql.yml
.github/workflows/maven.yml
.github/workflows/rebase.yml
.github/workflows/rebase-upstream.yml
.github/workflows/sync-upstream.yml
.github/workflows/create-upstream-pr.yml
.github/fork-specific-files.txt
README.md
67 changes: 67 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow checks out code, performs a Codacy security scan
# and integrates the results with the
# GitHub Advanced Security code scanning feature. For more information on
# the Codacy security scan action usage and parameters, see
# https://github.com/codacy/codacy-analysis-cli-action.
# For more information on Codacy Analysis CLI in general, see
# https://github.com/codacy/codacy-analysis-cli.

name: Codacy Security Scan

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '24 8 * * 2'

permissions:
contents: read

jobs:
codacy-security-scan:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v4

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@d840f886c4bd4edc059706d09c6a1586111c540b
# uses: codacy/codacy-analysis-cli-action@33d455949345bddfdb845fba76b57b70cc83754b
env:
CODEQL_ACTION_EXTRA_OPTIONS: '{"database":{"interpret-results":["--max-paths", 1]}}'

with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647




# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
126 changes: 126 additions & 0 deletions .github/workflows/create-upstream-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Create Upstream PR Branch

on:
workflow_dispatch:
inputs:
issue_number:
description: 'Issue number (used for branch name: upstream-pr/issue-{number})'
required: true
type: string
source_branch:
description: 'Source branch containing the commits to cherry-pick'
required: true
type: string
commit_shas:
description: 'Comma-separated list of commit SHAs to cherry-pick onto upstream/master'
required: true
type: string
pr_title:
description: 'Title for the upstream PR (informational only)'
required: false
type: string

jobs:
create-upstream-pr-branch:
name: Create Clean Upstream PR Branch
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Fetch upstream master
run: |
git remote add upstream https://github.com/eclipse-jdt/eclipse.jdt.ui.git
git fetch upstream master

- name: Create branch based on upstream/master
run: |
BRANCH_NAME="upstream-pr/issue-${{ inputs.issue_number }}"
git checkout -b "$BRANCH_NAME" upstream/master
echo "Created branch: $BRANCH_NAME"

- name: Cherry-pick specified commits
id: cherry_pick
run: |
BRANCH_NAME="upstream-pr/issue-${{ inputs.issue_number }}"
COMMIT_SHAS="${{ inputs.commit_shas }}"

# Convert comma-separated list to space-separated
SHAS=$(echo "$COMMIT_SHAS" | tr ',' ' ' | tr -s ' ')

echo "Cherry-picking commits: $SHAS"

SUCCESS=true
for SHA in $SHAS; do
SHA=$(echo "$SHA" | xargs) # trim whitespace
if [ -z "$SHA" ]; then
continue
fi
echo "Cherry-picking $SHA..."
if ! git cherry-pick "$SHA"; then
echo "Cherry-pick failed for $SHA"
git cherry-pick --abort 2>/dev/null || true
SUCCESS=false
break
fi
done

if [ "$SUCCESS" = "true" ]; then
echo "success=true" >> $GITHUB_OUTPUT
else
echo "success=false" >> $GITHUB_OUTPUT
fi

- name: Verify branch contents
if: steps.cherry_pick.outputs.success == 'true'
run: |
echo "=== Commits on this branch (not in upstream/master) ==="
git log upstream/master..HEAD --oneline
echo ""
echo "=== Files changed vs upstream/master ==="
git diff upstream/master..HEAD --stat

- name: Force-push branch to fork
if: steps.cherry_pick.outputs.success == 'true'
run: |
BRANCH_NAME="upstream-pr/issue-${{ inputs.issue_number }}"
git push --force origin "$BRANCH_NAME"
echo "✅ Branch '$BRANCH_NAME' pushed to fork"

- name: Output PR creation link
if: steps.cherry_pick.outputs.success == 'true'
run: |
BRANCH_NAME="upstream-pr/issue-${{ inputs.issue_number }}"
REPO_OWNER="${{ github.repository_owner }}"
REPO_NAME="${{ github.event.repository.name }}"
PR_LINK="https://github.com/eclipse-jdt/eclipse.jdt.ui/compare/master...${REPO_OWNER}:${REPO_NAME}:${BRANCH_NAME}"

echo ""
echo "=========================================="
echo "✅ Branch ready for upstream PR!"
echo "=========================================="
echo ""
echo "Branch: $BRANCH_NAME"
if [ -n "${{ inputs.pr_title }}" ]; then
echo "PR Title: ${{ inputs.pr_title }}"
fi
echo ""
echo "Create PR at:"
echo "$PR_LINK"
echo ""

- name: Fail if cherry-pick failed
if: steps.cherry_pick.outputs.success == 'false'
run: |
echo "❌ Cherry-pick failed. Check the logs above for details."
exit 1
36 changes: 36 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_run:
workflows: ["Sync Fork with Upstream"]
types: [completed]
branches: [master]

jobs:
build:
if: >-
github.event_name != 'workflow_run' ||
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Set up Maven
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
with:
maven-version: 3.9.9
- name: Build with Maven
run: mvn -B package -Pbuild-individual-bundles --file pom.xml
Loading
Loading