Skip to content

Commit

Permalink
get hugoversion from file (#331)
Browse files Browse the repository at this point in the history
* get hugoversion from file

* checkout before reading files

* checkout before reading files

* end quite fix
  • Loading branch information
drmowinckels authored Apr 18, 2024
1 parent 2fcb3c8 commit 19e79fe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ options(
blogdown.ext = ".Rmd",
blogdown.subdir = "blog",
blogdown.title_case = TRUE,
blogdown.hugo.version = "0.111.2",
blogdown.hugo.version = readLines(".hugoversion"),

renv.config.sandbox.enabled = FALSE,
renv.config.auto.snapshot = FALSE
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/build-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ jobs:
hugobd: public
on_fork: ${{ github.event.pull_request.head.repo.fork == true }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set env parameters
run: |
ver=$(cat .Rprofile | grep hugo.version | cut -d"=" -f2 | sed -e s.\"..g | sed -e s.\ ..g | sed -e s.,..g)
ver=$(cat .hugoversion)
echo "hugovr=$ver" >> $GITHUB_ENV
echo "repo_owner=$(dirname ${{ env.repo_name }})" >> $GITHUB_ENV
echo "repo_name=$(basename ${{ env.repo_name }})" >> $GITHUB_ENV
Expand All @@ -57,11 +62,6 @@ jobs:
echo "token=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
echo "blogsref=main" >> $GITHUB_ENV
fi
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Install cURL Headers
run: |
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
issue_number: ${{ env.issue }},
owner: 'rladies',
repo: '${{ env.repo_name }}',
body: 'Test build failed :sob: [Check out the build logs](https://github.com/rladies/rladies.github.io/actions/runs/${{ github.run_id }}).
body: 'Test build failed :sob: [Check out the build logs](https://github.com/rladies/rladies.github.io/actions/runs/${{ github.run_id }}).'
})
- uses: actions/github-script@v6
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/build-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ jobs:
RENV_CONFIG_SANDBOX_ENABLED: FALSE
hugobd: public
steps:
- name: Set env parameters
run: |
ver=$(cat .Rprofile | grep hugo.version | cut -d"=" -f2 | sed -e s.\"..g | sed -e s.\ ..g | sed -e s.,..g)
echo "hugovr=$ver" >> $GITHUB_ENV

- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set env parameters
run: |
ver=$(cat .hugoversion)
echo "hugovr=$ver" >> $GITHUB_ENV
- name: Install cURL Headers
run: |
Expand Down
1 change: 1 addition & 0 deletions .hugoversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.111.2

0 comments on commit 19e79fe

Please sign in to comment.