mirror of
				https://code.forgejo.org/actions/forgejo-release.git
				synced 2025-11-04 06:41:57 +02:00 
			
		
		
		
	feat: add default token and document default values (#44)
This PR adds `${{ secrets.GITHUB_TOKEN }}` as the default value for the token and documents all default values in the readme.
Fixes #43
Co-authored-by: Dorian Zedler <dorian@itsblue.de>
Reviewed-on: https://code.forgejo.org/actions/forgejo-release/pulls/44
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Co-authored-by: dorianim <dorianim@noreply.code.forgejo.org>
Co-committed-by: dorianim <dorianim@noreply.code.forgejo.org>
			
			
This commit is contained in:
		
							parent
							
								
									73ed2a76a2
								
							
						
					
					
						commit
						a6e3fdb19e
					
				
					 2 changed files with 10 additions and 21 deletions
				
			
		
							
								
								
									
										10
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								README.md
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -10,12 +10,12 @@ Upload or download the assets of a release to a Forgejo instance.
 | 
			
		|||
 | 
			
		||||
| name | description | required | default |
 | 
			
		||||
| --- | --- | --- | --- |
 | 
			
		||||
| `url` | <p>URL of the Forgejo instance</p> | `false` | `""` |
 | 
			
		||||
| `repo` | <p>owner/project relative to the URL</p> | `false` | `""` |
 | 
			
		||||
| `tag` | <p>Tag of the release</p> | `false` | `""` |
 | 
			
		||||
| `url` | <p>URL of the Forgejo instance</p> | `false` | `${{ env.GITHUB_SERVER_URL }}` |
 | 
			
		||||
| `repo` | <p>owner/project relative to the URL</p> | `false` | `${{ github.repository }}` |
 | 
			
		||||
| `tag` | <p>Tag of the release</p> | `false` | `${{ github.ref_name }}` |
 | 
			
		||||
| `title` | <p>Title of the release (defaults to tag)</p> | `false` | `""` |
 | 
			
		||||
| `sha` | <p>SHA of the release</p> | `false` | `""` |
 | 
			
		||||
| `token` | <p>Forgejo application token</p> | `true` | `""` |
 | 
			
		||||
| `sha` | <p>SHA of the release</p> | `false` | `${{ github.sha }}` |
 | 
			
		||||
| `token` | <p>Forgejo application token</p> | `false` | `${{ secrets.GITHUB_TOKEN }}` |
 | 
			
		||||
| `release-dir` | <p>Directory in whichs release assets are uploaded or downloaded</p> | `true` | `""` |
 | 
			
		||||
| `release-notes` | <p>Release notes</p> | `false` | `""` |
 | 
			
		||||
| `direction` | <p>Can either be <code>download</code> or <code>upload</code></p> | `true` | `""` |
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										21
									
								
								action.yml
									
										
									
									
									
								
							
							
						
						
									
										21
									
								
								action.yml
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -6,17 +6,21 @@ description: |
 | 
			
		|||
inputs:
 | 
			
		||||
  url:
 | 
			
		||||
    description: 'URL of the Forgejo instance'
 | 
			
		||||
    default: '${{ env.GITHUB_SERVER_URL }}'
 | 
			
		||||
  repo:
 | 
			
		||||
    description: 'owner/project relative to the URL'
 | 
			
		||||
    default: '${{ github.repository }}'
 | 
			
		||||
  tag:
 | 
			
		||||
    description: 'Tag of the release'
 | 
			
		||||
    default: '${{ github.ref_name }}'
 | 
			
		||||
  title:
 | 
			
		||||
    description: 'Title of the release (defaults to tag)'
 | 
			
		||||
  sha:
 | 
			
		||||
    description: 'SHA of the release'
 | 
			
		||||
    default: '${{ github.sha }}'
 | 
			
		||||
  token:
 | 
			
		||||
    description: 'Forgejo application token'
 | 
			
		||||
    required: true
 | 
			
		||||
    default: '${{ secrets.GITHUB_TOKEN }}'
 | 
			
		||||
  release-dir:
 | 
			
		||||
    description: 'Directory in whichs release assets are uploaded or downloaded'
 | 
			
		||||
    required: true
 | 
			
		||||
| 
						 | 
				
			
			@ -57,9 +61,6 @@ runs:
 | 
			
		|||
      shell: bash
 | 
			
		||||
    - run: |
 | 
			
		||||
        export FORGEJO="${{ inputs.url }}"
 | 
			
		||||
        if test -z "$FORGEJO"; then
 | 
			
		||||
          export FORGEJO="${{ env.GITHUB_SERVER_URL }}"
 | 
			
		||||
        fi
 | 
			
		||||
        # A trailing / will mean http://forgejo//api/v1 is used
 | 
			
		||||
        # and it always 401 as of v1.19, because of the double slash
 | 
			
		||||
        FORGEJO=${FORGEJO%%/}
 | 
			
		||||
| 
						 | 
				
			
			@ -67,17 +68,8 @@ runs:
 | 
			
		|||
        export HOST=${FORGEJO#*://}
 | 
			
		||||
 | 
			
		||||
        export REPO="${{ inputs.repo }}"
 | 
			
		||||
        if test -z "$REPO"; then
 | 
			
		||||
          export REPO="${{ github.repository }}"
 | 
			
		||||
        fi
 | 
			
		||||
 | 
			
		||||
        export TAG="${{ inputs.tag }}"
 | 
			
		||||
        if test -z "$TAG"; then
 | 
			
		||||
          export TAG="${{ github.ref_name }}"
 | 
			
		||||
          # until https://code.forgejo.org/forgejo/runner/issues/9 is fixed
 | 
			
		||||
          # trim refs/tags/
 | 
			
		||||
          TAG=${TAG##refs/tags/}
 | 
			
		||||
        fi
 | 
			
		||||
 | 
			
		||||
        export TITLE="${{ inputs.title }}"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -99,9 +91,6 @@ runs:
 | 
			
		|||
        )
 | 
			
		||||
 | 
			
		||||
        export SHA="${{ inputs.sha }}"
 | 
			
		||||
        if test -z "$SHA"; then
 | 
			
		||||
          export SHA="${{ github.sha }}"
 | 
			
		||||
        fi
 | 
			
		||||
 | 
			
		||||
        export OVERRIDE="${{ inputs.override }}"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue