1- name : Update Go Checksums
1+ name : Update Module Checksums
22
33on :
44 pull_request :
@@ -19,10 +19,10 @@ permissions:
1919
2020jobs :
2121 update :
22- name : Update Checksums
22+ name : Update Module Checksums
2323 runs-on : ubuntu-latest
2424 steps :
25- - name : Checkout code
25+ - name : Checkout repository
2626 uses : actions/checkout@v4
2727
2828 - name : Setup Hugo
3131 extended : true
3232 hugo-version : 0.145.0
3333
34- - name : Update checksums
34+ - name : Update module checksums
3535 uses : actions/github-script@v7
3636 with :
3737 github-token : ${{ secrets.GITHUB_TOKEN }}
@@ -52,16 +52,24 @@ jobs:
5252 ));
5353 const files = (await runGit(['diff', '--name-only'])).split('\n').filter(Boolean);
5454 if (files.length === 0) {
55- core.info('No changes detected');
55+ core.info('No file changes detected');
5656 return;
5757 }
58- const additions = await Promise.all(files.map(async file => {
59- const contents = await fs.readFile(file, 'utf-8');
60- return {
61- path: file,
62- contents: Buffer.from(contents).toString('base64')
63- };
64- }));
58+ const additions = await Promise.all((await runGit(['diff', '--name-only', '--diff-filter=AM']))
59+ .split('\n')
60+ .filter(Boolean)
61+ .map(async file => {
62+ const contents = await fs.readFile(file, 'utf-8');
63+ return {
64+ path: file,
65+ contents: Buffer.from(contents).toString('base64')
66+ };
67+ })
68+ );
69+ const deletions = (await runGit(['diff', '--name-only', '--diff-filter=D']))
70+ .split('\n')
71+ .filter(Boolean)
72+ .map(file => ({ path: file }));
6573 const input = {
6674 branch: {
6775 repositoryNameWithOwner: context.payload.repository.full_name,
7078 expectedHeadOid: context.payload.pull_request.head.sha,
7179 fileChanges: {
7280 additions: additions,
73- deletions: []
81+ deletions: deletions
7482 },
7583 message: { headline: 'chore(github-action): update module checksums' }
7684 };
0 commit comments