Skip to content

Commit

Permalink
feat: rename to shopware
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Jan 22, 2025
1 parent 9e0609d commit 2b6abbc
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 216 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ jobs:
fetch-depth: 0

- name: Install Shopware CLI
uses: FriendsOfShopware/shopware-cli-action@v1
uses: shopware/shopware-cli-action@v1

- name: Build and Package Extension
run: shopware-cli extension zip .
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Shopware CLI Action'
description: 'GitHub Action for Shopware CLI, a command line tool helper for Shopware'
author: 'FriendsOfShopware'
author: 'shopware AG'
branding:
color: 'green'
icon: 'package'
Expand Down
Binary file modified bun.lockb
Binary file not shown.
215 changes: 113 additions & 102 deletions dist/main/main.js

Large diffs are not rendered by default.

165 changes: 88 additions & 77 deletions dist/post/main.js

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions src/main/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,54 @@ import { Octokit } from '@octokit/action';
import { RequestError } from '@octokit/request-error';

export interface GitHubRelease {
tag_name: string;
tag_name: string;
}

const octokit = new Octokit();

async function getReleaseTag(tag: string) {
try {
const { data } = await octokit.rest.repos.getReleaseByTag({
owner: 'FriendsOfShopware',
repo: 'shopware-cli',
tag,
});

return data;
} catch (error) {
if (error instanceof RequestError) {
debug(`Could not fetch release ${tag} with status ${error.status}, ${error.message}`);
try {
const { data } = await octokit.rest.repos.getReleaseByTag({
owner: 'shopware',
repo: 'shopware-cli',
tag,
});

return data;
} catch (error) {
if (error instanceof RequestError) {
debug(`Could not fetch release ${tag} with status ${error.status}, ${error.message}`);
}

throw error;
}

throw error;
}
}

async function getLatestRelease() {
try {
const { data } = await octokit.rest.repos.getLatestRelease({
owner: 'FriendsOfShopware',
repo: 'shopware-cli',
});

return data;
} catch (error) {
if (error instanceof RequestError) {
debug(`Could not fetch latest release with status ${error.status}, ${error.message}`);
try {
const { data } = await octokit.rest.repos.getLatestRelease({
owner: 'shopware',
repo: 'shopware-cli',
});

return data;
} catch (error) {
if (error instanceof RequestError) {
debug(`Could not fetch latest release with status ${error.status}, ${error.message}`);
}

throw error;
}

throw error;
}
}

export async function getRelease(
version: string,
version: string,
) {
debug(`Fetching release ${version}`);
debug(`Fetching release ${version}`);

if (version === 'latest') {
return getLatestRelease();
}
if (version === 'latest') {
return getLatestRelease();
}

return getReleaseTag(version);
return getReleaseTag(version);
}

0 comments on commit 2b6abbc

Please sign in to comment.