Skip to content

Commit dca6bac

Browse files
authored
Merge branch 'main' into reapply-chmod-removal-for-v2
2 parents 9c071e6 + 3138c05 commit dca6bac

File tree

1 file changed

+39
-31
lines changed

1 file changed

+39
-31
lines changed

README.md

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
A composite Action for packaging and uploading artifact that can be deployed to [GitHub Pages][pages].
44

5-
# Scope
5+
## Scope
66

77
⚠️ Official support for building Pages with Actions is in public beta at the moment.
88

9-
# Usage
9+
## Usage
1010

1111
See [action.yml](action.yml)
1212

1313
<!-- TODO: document custom workflow -->
1414

15-
# Artifact validation
15+
## Artifact validation
1616

1717
While using this action is optional, we highly recommend it since it takes care of producing (mostly) valid artifacts.
1818

@@ -25,40 +25,48 @@ The [`tar` file][tar] must:
2525

2626
- be under 10GB in size
2727
- not contain any symbolic or hard links
28+
- contain only files and directories that all meet the expected minimum [file permissions](#file-permissions)
2829

29-
# File Permissions
30+
### File permissions
3031

31-
When using this action ensure your files have appropriate file permission, we expect at a minimum for the files to have permission for the current user (e.g 0744).
32-
Failure to do so will result in a `deployment_perms_error` when attempting to deploy your artifacts.
32+
When using this action, ensure that your files have appropriate file permissions.
33+
At a minimum, GitHub Pages expects:
34+
- files to have read permission for the current user and the "Others" user role (e.g. `0744`, `0644`, `0444`)
35+
- directories to have read and execute permissions for the current user and the "Others" user role (e.g. `0755`, `0555`)
36+
37+
Failure to supply adequate permissions will result in a `deployment_perms_error` when attempting to deploy your artifacts to GitHub Pages.
38+
39+
#### Example permissions fix for Linux
3340

3441
```yaml
35-
...
36-
runs:
37-
using: composite
38-
steps:
39-
- name: Archive artifact
40-
shell: sh
41-
if: runner.os == 'Linux'
42-
run: |
43-
chmod -c -R +rX "$INPUT_PATH" |
44-
while read line; do
45-
echo "::warning title=Invalid file permissions automatically fixed::$line"
46-
done
47-
tar \
48-
--dereference --hard-dereference \
49-
--directory "$INPUT_PATH" \
50-
-cvf "$RUNNER_TEMP/artifact.tar" \
51-
--exclude=.git \
52-
--exclude=.github \
53-
.
54-
env:
55-
INPUT_PATH: ${{ inputs.path }}
56-
57-
...
42+
steps:
43+
# ...
44+
- name: Fix permissions
45+
run: |
46+
chmod -c -R +rX "_site/" | while read line; do
47+
echo "::warning title=Invalid file permissions automatically fixed::$line"
48+
done
49+
- name: Upload Pages artifact
50+
uses: actions/upload-pages-artifact@v2
51+
# ...
5852
```
5953

54+
#### Example permissions fix for Mac
55+
56+
```yaml
57+
steps:
58+
# ...
59+
- name: Fix permissions
60+
run: |
61+
chmod -v -R +rX "_site/" | while read line; do
62+
echo "::warning title=Invalid file permissions automatically fixed::$line"
63+
done
64+
- name: Upload Pages artifact
65+
uses: actions/upload-pages-artifact@v2
66+
# ...
67+
```
6068

61-
# Release instructions
69+
## Release instructions
6270

6371
In order to release a new version of this Action:
6472

@@ -70,7 +78,7 @@ In order to release a new version of this Action:
7078

7179
⚠️ Environment approval is required. Check the [Release workflow run list][release-workflow-runs].
7280

73-
# License
81+
## License
7482

7583
The scripts and documentation in this project are released under the [MIT License](LICENSE).
7684

0 commit comments

Comments
 (0)