Skip to content

TuftsRT/get-pages-url

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

get-pages-url

GitHub action to retrieve the GitHub Pages URL for a repository. This action attempts to fetch the URL using the GitHub API and falls back to constructing the URL based on repository naming conventions if the API request fails. Default behavior does not require any inputs and outputs the pages URL of the repository the action is run from. The action can be used to retrieve the pages URL of a different repository if an access token is provided.

This is a composite action and hence must be run on a Linux-based runner like ubuntu-latest or similar.

Developed and maintained by Research Technology (RT), Tufts Technology Services (TTS), Tufts University.

Inputs

  • repository

    • Repository for which to get the GitHub Pages URL. Must be in owner/repo format. Defaults to the current repository.
    • Default: ${{ github.repository }}
  • token

    • GitHub token with read permissions for the pages scope. Defaults to the GITHUB_TOKEN secret of the current repository.
    • Default: ${{ github.token }}

Outputs

  • url

    • The GitHub Pages URL for the repository.

Usage Example

name: build-main
on:
  push:
    branches:
      - main
jobs:
  build-main:
    runs-on: ubuntu-latest
    steps:
      - id: get-url
        uses: tuftsrt/get-pages-url@v1
      - uses: tuftsrt/sphinx-to-branch@v1
        env:
          BASEURL: ${{ steps.get-url.outputs.url }}

Note how the outputted URL can be passed onto a subsequent step as an environment variable.

About

GitHub action to retrieve the GitHub Pages URL for a repository

Resources

License

Stars

Watchers

Forks

Packages

No packages published