Skip to content

Commit dcbbe22

Browse files
committed
fix(pages): link PR artifacts to the checked-out commit
1 parent 57ccb89 commit dcbbe22

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎.github/workflows/casket-pages.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ jobs:
6565

6666
- name: Prepare site source
6767
shell: bash
68+
env:
69+
CONTENT_REF: ${{ github.event_name == 'pull_request' && github.sha || github.ref_name }}
6870
run: |
6971
set -euo pipefail
7072
rm -rf .site-src _site
@@ -79,9 +81,9 @@ jobs:
7981
README_URL=""
8082
8183
if [ -f README.md ]; then
82-
README_URL="${REPO_URL}/blob/${{ github.ref_name }}/README.md"
84+
README_URL="${REPO_URL}/blob/${CONTENT_REF}/README.md"
8385
elif [ -f README.adoc ]; then
84-
README_URL="${REPO_URL}/blob/${{ github.ref_name }}/README.adoc"
86+
README_URL="${REPO_URL}/blob/${CONTENT_REF}/README.adoc"
8587
fi
8688
8789
{
@@ -99,7 +101,7 @@ jobs:
99101
echo "- README: [project README](${README_URL})"
100102
fi
101103
if [ -d docs ]; then
102-
echo "- Docs directory: [docs/](${REPO_URL}/tree/${{ github.ref_name }}/docs)"
104+
echo "- Docs directory: [docs/](${REPO_URL}/tree/${CONTENT_REF}/docs)"
103105
fi
104106
echo
105107
echo "Project-specific site content can be added later under site/."

‎robot-repo-automaton/src/main.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,8 @@ fn cmd_catalog(path: &Path, severity_filter: Option<&str>) -> anyhow::Result<()>
745745
/// Base directory holding local repo checkouts.
746746
///
747747
/// Override with `REPOS_BASE`; otherwise defaults to the canonical estate tree.
748+
/// Legacy checkout locations can also be selected through `REPOS_BASE`; the
749+
/// former literal `/var$REPOS_DIR` path did not expand a shell variable in Rust.
748750
fn repos_base() -> PathBuf {
749751
if let Ok(base) = std::env::var("REPOS_BASE") {
750752
if !base.is_empty() {

0 commit comments

Comments
 (0)