File tree Expand file tree Collapse file tree 1 file changed +8
-25
lines changed Expand file tree Collapse file tree 1 file changed +8
-25
lines changed Original file line number Diff line number Diff line change @@ -29,31 +29,14 @@ jobs:
29
29
30
30
- name : Check for changes
31
31
id : check_changes
32
- uses : actions/github-script@v7
33
- with :
34
- script : |
35
- try {
36
- const result = await github.rest.repos.compareCommits({
37
- owner: context.repo.owner,
38
- repo: context.repo.repo,
39
- base: 'master',
40
- head: 'update-readme-${{ github.run_number }}'
41
- });
42
- if (result.data.files.length > 0) {
43
- console.log("Changes detected");
44
- core.setOutput("changes_detected", "true");
45
- } else {
46
- console.log("No changes detected");
47
- core.setOutput("changes_detected", "false");
48
- }
49
- } catch (error) {
50
- if (error.status === 404) {
51
- console.log("Branch not found, no changes detected");
52
- core.setOutput("changes_detected", "false");
53
- } else {
54
- throw error;
55
- }
56
- }
32
+ run : |
33
+ if git diff --quiet; then
34
+ echo "No changes detected"
35
+ echo "changes_detected=false" >> $GITHUB_OUTPUT
36
+ else
37
+ echo "Changes detected"
38
+ echo "changes_detected=true" >> $GITHUB_OUTPUT
39
+ fi
57
40
58
41
- name : Commit README.md updates
59
42
if : steps.check_changes.outputs.changes_detected == 'true'
You can’t perform that action at this time.
0 commit comments