1 # doc: https://github.com/redhat-plumbers-in-action/devel-freezer#readme
4 name: Development Freeze
7 workflows: [ Gather Pull Request Metadata ]
12 PULL_REQUEST_METADATA_DIR: pull_request
13 PULL_REQUEST_METADATA_FILE: metadata
21 github.event.workflow_run.event == 'pull_request' &&
22 github.event.workflow_run.conclusion == 'success' &&
23 github.repository == 'systemd/systemd'
30 - name: Download Pull Request Metadata artifact
31 uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
34 const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
35 owner: context.repo.owner,
36 repo: context.repo.repo,
37 run_id: ${{ github.event.workflow_run.id }},
40 const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
41 return artifact.name == "${{ env.PULL_REQUEST_METADATA_FILE }}"
44 const download = await github.rest.actions.downloadArtifact({
45 owner: context.repo.owner,
46 repo: context.repo.repo,
47 artifact_id: matchArtifact.id,
48 archive_format: 'zip',
51 const fs = require('fs');
52 fs.writeFileSync('${{ github.workspace }}/${{ env.PULL_REQUEST_METADATA_FILE }}.zip', Buffer.from(download.data));
54 - run: unzip ${{ env.PULL_REQUEST_METADATA_FILE }}.zip
56 - name: 'Get Pull Request number'
57 uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
59 github-token: ${{ secrets.GITHUB_TOKEN }}
61 const fs = require('fs');
62 const pr_number = Number(fs.readFileSync('./${{ env.PULL_REQUEST_METADATA_FILE }}'));
63 core.exportVariable('pr_number', pr_number);
65 - name: Repository checkout
66 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
70 - name: Development Freezer
71 uses: redhat-plumbers-in-action/devel-freezer@13b6551f19ade74ca79be4cab06b815a4ffffa64
73 pr-number: ${{ env.pr_number }}
74 token: ${{ secrets.GITHUB_TOKEN }}