Fix split up actions (#141)
This commit is contained in:
		
							
								
								
									
										35
									
								
								.github/workflows/automerge_dependabot.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										35
									
								
								.github/workflows/automerge_dependabot.yml
									
									
									
									
										vendored
									
									
								
							@@ -2,7 +2,7 @@ name: Auto-merge Dependabot PRs
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  workflow_run:
 | 
			
		||||
    workflows: [ "OpenInv CI" ]
 | 
			
		||||
    workflows: [ "Pull Request" ]
 | 
			
		||||
    types: [ completed ]
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
@@ -12,15 +12,44 @@ jobs:
 | 
			
		||||
      && github.event.workflow_run.conclusion == 'success'"
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      # Note: this is directly from GitHub's example for using data from a triggering workflow:
 | 
			
		||||
      # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
 | 
			
		||||
      - name: 'Download artifact'
 | 
			
		||||
        uses: actions/github-script@v6
 | 
			
		||||
        with:
 | 
			
		||||
          script: |
 | 
			
		||||
            let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
 | 
			
		||||
               owner: context.repo.owner,
 | 
			
		||||
               repo: context.repo.repo,
 | 
			
		||||
               run_id: context.payload.workflow_run.id,
 | 
			
		||||
            });
 | 
			
		||||
            let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
 | 
			
		||||
              return artifact.name == "pr_number"
 | 
			
		||||
            })[0];
 | 
			
		||||
            let download = await github.rest.actions.downloadArtifact({
 | 
			
		||||
               owner: context.repo.owner,
 | 
			
		||||
               repo: context.repo.repo,
 | 
			
		||||
               artifact_id: matchArtifact.id,
 | 
			
		||||
               archive_format: 'zip',
 | 
			
		||||
            });
 | 
			
		||||
            let fs = require('fs');
 | 
			
		||||
            fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_number.zip`, Buffer.from(download.data));
 | 
			
		||||
 | 
			
		||||
      # This might be a useless use of cat, but I'm not sure what shell Actions is going to be running.
 | 
			
		||||
      - name: Add Pull Number Variable
 | 
			
		||||
        run: |-
 | 
			
		||||
          unzip pr_number.zip
 | 
			
		||||
          echo "PR_NUMBER=$(cat pr_number)" >> "$GITHUB_ENV"
 | 
			
		||||
 | 
			
		||||
      - name: Approve
 | 
			
		||||
        uses: hmarr/auto-approve-action@v3.2.1
 | 
			
		||||
        with:
 | 
			
		||||
          github-token: "${{ secrets.GITHUB_TOKEN }}"
 | 
			
		||||
          pull-request-number: "${{ github.event.workflow_run.event.pull_request.id }}"
 | 
			
		||||
          pull-request-number: "${{ env.PR_NUMBER }}"
 | 
			
		||||
      - name: Merge
 | 
			
		||||
        uses: pascalgn/automerge-action@v0.15.6
 | 
			
		||||
        env:
 | 
			
		||||
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
 | 
			
		||||
          MERGE_LABELS: "dependencies,java"
 | 
			
		||||
          MERGE_METHOD: "squash"
 | 
			
		||||
          PULL_REQUEST: "${{ github.event.workflow_run.event.pull_request.id }}"
 | 
			
		||||
          PULL_REQUEST: "${{ env.PR_NUMBER }}"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user