Quick Test - File Upload #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Quick Test - File Upload | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| obs_bucket: | |
| description: 'OBS bucket name' | |
| required: false | |
| type: string | |
| test_file_content: | |
| description: 'Content for test file' | |
| required: false | |
| default: 'Hello from GitHub Actions!' | |
| type: string | |
| env: | |
| OBS_BUCKET: ${{ inputs.obs_bucket || secrets.OBS_BUCKET }} | |
| OBS_KEY_ID: ${{ secrets.OBS_KEY_ID }} | |
| OBS_KEY_SECRET: ${{ secrets.OBS_KEY_SECRET }} | |
| jobs: | |
| quick-upload-test: | |
| runs-on: ubuntu-latest | |
| name: Quick Upload Test | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build the action | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Create test file | |
| run: | | |
| echo "${{ inputs.test_file_content }}" > test-file.txt | |
| echo "Created test file with content:" | |
| cat test-file.txt | |
| - name: Test file upload | |
| uses: ./ | |
| with: | |
| access_key: ${{ env.OBS_KEY_ID }} | |
| secret_key: ${{ env.OBS_KEY_SECRET }} | |
| region: cn-north-4 | |
| bucket_name: ${{ env.OBS_BUCKET }} | |
| operation: upload | |
| source: test-file.txt | |
| destination: quick-test/ | |
| progress: true | |
| dry_run: false | |
| - name: Verify upload | |
| run: | | |
| echo "Upload completed successfully!" | |
| echo "Check your OBS bucket '${{ env.OBS_BUCKET }}' for the file at 'quick-test/test-file.txt'" | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| rm -f test-file.txt |