diff --git a/.github/workflows/auto_merged_pr.yml b/.github/workflows/auto_merged_pr.yml new file mode 100644 index 0000000..0b9a922 --- /dev/null +++ b/.github/workflows/auto_merged_pr.yml @@ -0,0 +1,26 @@ +name: Auto_PR_Mered +on: + pull_request: +permissions: + contents: write + +jobs: + auto-merge-eclipse: + runs-on: ubuntu-latest + if: > + github.event.pull_request.user.login == 'cx-bot-ghinternal' && + contains(github.event.pull_request.title, 'Eclipse Plugin Release') + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Enable auto-merge for eligible PRs + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.ECLIPSE_SITE_TOKEN }} + run: gh pr merge --auto --squash "$PR_URL" + + - name: Auto approve PRs + uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 + with: + github-token: ${{ secrets.ECLIPSE_SITE_TOKEN }} diff --git a/.github/workflows/jira-id-validation.yaml b/.github/workflows/jira-id-validation.yaml new file mode 100644 index 0000000..3498a90 --- /dev/null +++ b/.github/workflows/jira-id-validation.yaml @@ -0,0 +1,35 @@ +name: Jira ID Validation in GH PRs or Branch Names + +on: + pull_request: + types: [opened, reopened, synchronize, edited] + branches: [main, master] + +concurrency: + group: jira-validation-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + validate-jira-id: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: CheckmarxDev/Repository-Rules + token: ${{ secrets.GH_TOKEN }} + ref: AST-137615 # branch to test + + - name: Install Dependencies + run: pip install requests + + - name: Validate Jira ID + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPOSITORY: ${{ github.repository }} + PR_NUMBER: ${{ github.event.pull_request.number }} + BRANCH_NAME: ${{ github.head_ref }} + JIRA_USER: ${{ secrets.JIRA_EMAIL }} + JIRA_API_TOKEN: ${{ secrets.JIRA_CX_TOKEN }} + BACKDOOR_KEYWORD: ${{ secrets.BACKDOOR_KEYWORD }} + run: python scripts/jira_id_validation.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..407eb4e --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# +# +#